@@ -2104,7 +2104,34 @@ static string[] GetScenes()
21042104
21052105 }
21062106
2107- // runs unity SimpleWebServer.exe and launches default Browser into project build/ folder'
2107+ public static void BuildProjectCustom ( Project proj )
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+ var unityExePath = 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+ var buildParams = $ " -quit -batchmode -nographics -projectPath \" { proj . Path } \" -executeMethod \" UnityLauncherProToolsCustom.BuildCustom\" ";
2120+ Console . WriteLine ( "buildcmd= " + buildParams ) ;
2121+
2122+ // launch build
2123+ var proc = 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 public static void LaunchWebGL ( Project proj , string relativeFolder )
21092136 {
21102137 var projPath = proj ? . Path . Replace ( '/' , '\\ ' ) ;
0 commit comments