diff options
author | Jose Miguel Torres <jostor@microsoft.com> | 2019-10-24 13:26:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-24 13:26:30 +0300 |
commit | 6b2e91dc388daa9317bb6f3cf09d5132492d698d (patch) | |
tree | 50c47b7642a7b9c15074e0bba68e7763ed3cedb6 /main/src/core/MonoDevelop.Core | |
parent | 8574adcc2afa7a003ae54374eab01a6a94adb87b (diff) | |
parent | 03833e08aeb5088fe19bfbe0ccbec094a21b8d2b (diff) |
Merge pull request #9019 from mono/error-counter
[Core] Add counter information for project build errors
Diffstat (limited to 'main/src/core/MonoDevelop.Core')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs | 10 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs | 16 |
2 files changed, 24 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs index 4634dbc32e..dd76a0717d 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs @@ -1607,11 +1607,17 @@ namespace MonoDevelop.Projects metadata.FirstBuild = IsFirstBuild; - bool success = false; + bool success = true; bool cancelled = false; if (result != null) { - success = !result.Errors.Any (error => !error.IsWarning); + foreach (var error in result.Errors) { + bool isError = !error.IsWarning; + if (isError) { + success = false; + metadata.RegisterError (error.Code); + } + } if (!success) { cancelled = result.Errors [0].Message == "Build cancelled"; diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs index 19b8dd91e7..d3296fdee1 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs @@ -1890,5 +1890,21 @@ namespace MonoDevelop.Projects get => GetProperty<bool> (); set => SetProperty (value); } + + Dictionary<string, int> errors; + + public void RegisterError(string errorCode) + { + if (errorCode == null) + return; + + if (errors == null) { + errors = new Dictionary<string, int> (); + SetProperty (errors, "Errors"); + } + + errors.TryGetValue (errorCode, out int value); + errors [errorCode] = value + 1; + } } } |