Skip to content

Instantly share code, notes, and snippets.

@rkandas
Last active August 11, 2019 13:21
Show Gist options
  • Save rkandas/f5a71b13759edbd9b76f04f0cfb15e53 to your computer and use it in GitHub Desktop.
Save rkandas/f5a71b13759edbd9b76f04f0cfb15e53 to your computer and use it in GitHub Desktop.
static void PerformBuild ()
{
Console.WriteLine (":: Performing build");
var buildTarget = GetBuildTarget ();
var buildPath = GetBuildPath ();
var buildName = GetBuildName ();
var fixedBuildPath = GetFixedBuildPath (buildTarget, buildPath, buildName);
Console.WriteLine("Fixed build path:" + fixedBuildPath);
var buildInfo = BuildPipeline.BuildPlayer (GetEnabledScenes (), fixedBuildPath, buildTarget, GetBuildOptions ());
if( buildInfo.summary.result == BuildResult.Succeeded ) {
Console.WriteLine (":: Done with build");
}
else {
Console.WriteLine (":: Build error");
foreach (var step in buildInfo.steps) {
foreach (var message in step.messages) {
Console.WriteLine (step.name + " -- " + message.content);
}
}
EditorApplication.Exit( 1 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment