Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf90e8ac

Browse files
authored
Merge pull request#199 from krisrok/feature/build_custom
Add a quick "custom" build command
2 parents07432f9 +da156d9 commitf90e8ac

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

‎UnityLauncherPro/MainWindow.xaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
<MenuItemHeader="Build">
228228
<MenuItemx:Name="menuBatchBuildAndroid"Header="Android"Click="MenuBatchBuildAndroid_Click"/>
229229
<MenuItemx:Name="menuBatchBuildIOS"Header="IOS"Click="MenuBatchBuildIOS_Click"/>
230+
<MenuItemx:Name="menuBatchBuildCustom"Header="Custom"Click="MenuBatchBuildCustom_Click"/>
230231
</MenuItem>
231232
<MenuItemHeader="Tools">
232233
<MenuItemx:Name="menuExcludeFromDefender"Header="Exclude Path From Defender"Click="menuExcludeFromDefender_Click"/>

‎UnityLauncherPro/MainWindow.xaml.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3226,6 +3226,12 @@ private void MenuBatchBuildIOS_Click(object sender, RoutedEventArgs e)
32263226
Tools.BuildProject(proj,Platform.iOS);
32273227
}
32283228

3229+
privatevoidMenuBatchBuildCustom_Click(objectsender,RoutedEventArgse)
3230+
{
3231+
varproj=GetSelectedProject();
3232+
Tools.BuildProjectCustom(proj);
3233+
}
3234+
32293235
privatevoidChkCheckPlasticBranch_Checked(objectsender,RoutedEventArgse)
32303236
{
32313237
if(this.IsActive==false)return;// dont run code on window init

‎UnityLauncherPro/Tools.cs‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,34 @@ static string[] GetScenes()
21042104

21052105
}
21062106

2107-
// runs unity SimpleWebServer.exe and launches default Browser into project build/ folder'
2107+
publicstaticvoidBuildProjectCustom(Projectproj)
2108+
{
2109+
Console.WriteLine("Building "+proj.Title+" (custom)");
2110+
SetStatus("Build process started: "+DateTime.Now.ToString("HH:mm:ss"));
2111+
2112+
// get selected project unity exe path
2113+
varunityExePath=Tools.GetUnityExePath(proj.Version);
2114+
if(unityExePath==null)return;
2115+
2116+
// create commandline string for building and launch it
2117+
//var buildcmd = $"\"{unityExePath}\" -quit -batchmode -nographics -projectPath \"{proj.Path}\" -executeMethod \"Builder.BuildAndroid\" -buildTarget android -logFile -";
2118+
// TODO test without nographics : https://forum.unity.com/threads/batch-build-one-scene-is-black-works-in-normal-file-build.1282823/#post-9456524
2119+
varbuildParams=$" -quit -batchmode -nographics -projectPath\"{proj.Path}\" -executeMethod\"UnityLauncherProToolsCustom.BuildCustom\"";
2120+
Console.WriteLine("buildcmd= "+buildParams);
2121+
2122+
// launch build
2123+
varproc=Tools.LaunchExe(unityExePath,buildParams);
2124+
2125+
// wait for process exit then open output folder
2126+
proc.Exited+=(o,i)=>
2127+
{
2128+
SetStatus("Build process finished: "+DateTime.Now.ToString("HH:mm:ss"));
2129+
// TODO set color based on results
2130+
SetBuildStatus(Colors.Green);
2131+
};
2132+
}
2133+
2134+
// runs unity SimpleWebServer.exe and launches default Browser into project build/ folder'
21082135
publicstaticvoidLaunchWebGL(Projectproj,stringrelativeFolder)
21092136
{
21102137
varprojPath=proj?.Path.Replace('/','\\');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp