Change Globals.BuildErrors into BuildException #1673
This commit is contained in:
@@ -628,10 +628,7 @@ namespace Flax.Build
|
||||
}
|
||||
}
|
||||
if (failed)
|
||||
{
|
||||
Globals.BuildErrors = true;
|
||||
throw new Exception($"Failed to build target {target.Name}. See log.");
|
||||
}
|
||||
throw new BuildException($"Failed to build target {target.Name}. See log.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -692,10 +689,7 @@ namespace Flax.Build
|
||||
}
|
||||
}
|
||||
if (failed)
|
||||
{
|
||||
Globals.BuildErrors = true;
|
||||
throw new Exception($"Failed to build target {target.Name}. See log.");
|
||||
}
|
||||
throw new BuildException($"Failed to build target {target.Name}. See log.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -22,11 +22,6 @@ namespace Flax.Build
|
||||
/// </summary>
|
||||
public static ProjectInfo Project;
|
||||
|
||||
/// <summary>
|
||||
/// Set when any build related errors were raised.
|
||||
/// </summary>
|
||||
public static bool BuildErrors = false;
|
||||
|
||||
/// <summary>
|
||||
/// All platforms array.
|
||||
/// </summary>
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace Flax.Build
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Ignore exception logging for build errors
|
||||
if (!Globals.BuildErrors)
|
||||
if (!(ex is BuildException))
|
||||
Log.Exception(ex);
|
||||
failed = true;
|
||||
}
|
||||
|
||||
@@ -525,7 +525,7 @@ namespace Flax.Build.Projects.VisualStudio
|
||||
// Build C# projects (needed for Rider solution wide analysis)
|
||||
build |= project.Type == TargetType.DotNetCore;
|
||||
|
||||
//
|
||||
// Always build the project named after solution if main project was not set
|
||||
build |= solution.MainProject == null && project.Name == solution.Name;
|
||||
}
|
||||
else if (firstPlatformMatch != -1 && !configuration.Name.StartsWith("Editor."))
|
||||
|
||||
14
Source/Tools/Flax.Build/Utilities/BuildException.cs
Normal file
14
Source/Tools/Flax.Build/Utilities/BuildException.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Flax.Build
|
||||
{
|
||||
internal class BuildException : Exception
|
||||
{
|
||||
public BuildException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user