From d63625c02b560cbb72f29db6a293db33512ea2f9 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Sun, 5 Aug 2018 15:29:14 -0700 Subject: [PATCH 1/3] Fix build warning and treat msbuild warnings as errors --- .../dotnet-dependency-tool-invoker.csproj | 4 +++- build/BuildDefaults.props | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj index f625dcbe6..a6e830926 100644 --- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj +++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj @@ -1,8 +1,9 @@ - + + 1.0.0-rc @@ -23,4 +24,5 @@ + diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index d574b1789..1f26ed860 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -33,5 +33,6 @@ NU1701;NU5104 true + true From 1ec1f612aa62d01dff1d43170c63cea4fccb2dd3 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Mon, 6 Aug 2018 11:16:45 -0700 Subject: [PATCH 2/3] Don't let crossgen warnings become msbuild warnings-as-errors --- build_projects/dotnet-cli-build/Crossgen.cs | 33 ++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/build_projects/dotnet-cli-build/Crossgen.cs b/build_projects/dotnet-cli-build/Crossgen.cs index 48ebdebfa..8c4d4954e 100644 --- a/build_projects/dotnet-cli-build/Crossgen.cs +++ b/build_projects/dotnet-cli-build/Crossgen.cs @@ -82,7 +82,38 @@ namespace Microsoft.DotNet.Build.Tasks protected override MessageImportance StandardOutputLoggingImportance { - get { return MessageImportance.High; } // or else the output doesn't get logged by default + // Default is low, but we want to see output at normal verbosity. + get { return MessageImportance.Normal; } + } + + protected override MessageImportance StandardErrorLoggingImportance + { + // This turns stderr messages into msbuild errors below. + get { return MessageImportance.High; } + } + + protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance) + { + // Crossgen's error/warning formatting is inconsistent and so we do + // not use the "canonical error format" handling of base. + // + // Furthermore, we don't want to log crossgen warnings as msbuild + // warnings because we cannot prevent them and they are only + // occasionally formatted as something that base would recognize as + // a canonically formatted warning anyway. + // + // One thing that is consistent is that crossgne errors go to stderr + // and everything else goes to stdout. Above, we set stderr to high + // importance above, and stdout to normal. So we can use that here + // to distinguish between errors and messages. + if (messageImportance == MessageImportance.High) + { + Log.LogError(singleLine); + } + else + { + Log.LogMessage(messageImportance, singleLine); + } } protected override string GenerateFullPathToTool() From 624259561378c27833707a719aa0ea0cf0d4dfee Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Mon, 6 Aug 2018 13:23:11 -0700 Subject: [PATCH 3/3] Fix warnings-as-errors in Linux packaging --- build/DependencyVersions.props | 2 +- build/package/Installer.DEB.proj | 29 +++++++++++++++-------------- build/package/Installer.RPM.targets | 3 ++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 07e237526..048583f64 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -78,7 +78,7 @@ 2.1.0-prerelease-02430-04 $(BuildTasksFeedToolVersion) - 2.0.0-preview2-25331-01 + 2.0.0 diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index 0e516f440..51de5c615 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -94,12 +94,12 @@ UseHardlinksIfPossible="False" /> - - - - - - + + + + + + - - - - - - + + + + + + @@ -174,8 +174,9 @@ - - + + + diff --git a/build/package/Installer.RPM.targets b/build/package/Installer.RPM.targets index e6e4fa917..3a9990d62 100644 --- a/build/package/Installer.RPM.targets +++ b/build/package/Installer.RPM.targets @@ -196,7 +196,8 @@ - + +