Change Globals.BuildErrors into BuildException #1673
This commit is contained in:
@@ -628,10 +628,7 @@ namespace Flax.Build
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (failed)
|
if (failed)
|
||||||
{
|
throw new BuildException($"Failed to build target {target.Name}. See log.");
|
||||||
Globals.BuildErrors = true;
|
|
||||||
throw new Exception($"Failed to build target {target.Name}. See log.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -692,10 +689,7 @@ namespace Flax.Build
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (failed)
|
if (failed)
|
||||||
{
|
throw new BuildException($"Failed to build target {target.Name}. See log.");
|
||||||
Globals.BuildErrors = true;
|
|
||||||
throw new Exception($"Failed to build target {target.Name}. See log.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,11 +22,6 @@ namespace Flax.Build
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static ProjectInfo Project;
|
public static ProjectInfo Project;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Set when any build related errors were raised.
|
|
||||||
/// </summary>
|
|
||||||
public static bool BuildErrors = false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All platforms array.
|
/// All platforms array.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ namespace Flax.Build
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// Ignore exception logging for build errors
|
// Ignore exception logging for build errors
|
||||||
if (!Globals.BuildErrors)
|
if (!(ex is BuildException))
|
||||||
Log.Exception(ex);
|
Log.Exception(ex);
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ namespace Flax.Build.Projects.VisualStudio
|
|||||||
// Build C# projects (needed for Rider solution wide analysis)
|
// Build C# projects (needed for Rider solution wide analysis)
|
||||||
build |= project.Type == TargetType.DotNetCore;
|
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;
|
build |= solution.MainProject == null && project.Name == solution.Name;
|
||||||
}
|
}
|
||||||
else if (firstPlatformMatch != -1 && !configuration.Name.StartsWith("Editor."))
|
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