I’ve made a batch file with the following command line:
"C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformBuild
Which calls the following method:
static void PerformBuild ()
{
string[] scenes = { "1.unity","2.unity","3.unity","4.unity","5.unity" };
BuildPipeline.BuildPlayer(scenes,"win.exe",BuildTarget.StandaloneWindows,BuildOptions.None);
BuildPipeline.BuildPlayer(scenes,"osx.app",BuildTarget.StandaloneOSXUniversal,BuildOptions.None);
BuildPipeline.BuildPlayer(scenes,"WebPlayer.unity3d",BuildTarget.WebPlayerStreamed,BuildOptions.None);
scenes = null;
}
It does build the three players but unfortunately it only compiles one of them.
Is there anyway to force compile before building? Am I missing something?
EDIT:
I tried separating in different functions and different calls and the same thing happens, I get the 3 builds but only one has been compiled, the other 2 act as if there were no changes to the code.
"C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformWebBuild
"C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformWindowsBuild
"C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchMode -quit -nographics -projectPath C:\project -executeMethod AutoBuilder.PerformWebBuild