Skip to main content
Search our knowledge base

Why doesn't a failed BuildPipeline.BuildPlayer return an error code in the command line?

Comments

3 comments

  • Jordi Bonastre

    Perfect for my Jenkins system =)

    0
  • Casey Pugh

    This was updated in a later Unity version. BuildPlayer now returns BuildReport. I fixed it by doing:

    if (report.summary.result != BuildResult.Succeeded)
    {
       EditorApplication.Exit(0);
    }
    else
    {
       EditorApplication.Exit(1);
    }

     

    0
  • Nguyen Thanh Dung

    The if statement should be opposite, no?

    if (report.summary.result == BuildResult.Succeeded)

    Because Jenkins will mark as Successful if the exit code is 0, not 1.

    1

Please sign in to leave a comment.