Blob Blame History Raw
From a542e1977bf264a1a4e26f0e978387668c74b798 Mon Sep 17 00:00:00 2001
From: Davis Goodin <dagood@microsoft.com>
Date: Wed, 14 Nov 2018 10:05:41 -0600
Subject: [PATCH] Set IgnoreStandardErrorWarningFormat on Execs

For every Exec that takes RedirectRepoOutputToLog, ignore standard error/warning format. If it isn't ignored, there might be problems that are ignored by redirecting to the logs that aren't ignored if redirecting is turned off. Configure Exec not to detect these at all to behave the same whether redirecting or not.
---
 repos/application-insights.proj |  9 ++++++---
 repos/dir.targets               | 21 ++++++++++++---------
 repos/netcorecli-fsc.proj       |  3 ++-
 repos/newtonsoft-json.proj      |  3 ++-
 repos/nuget-client.proj         |  9 ++++++---
 repos/roslyn.proj               |  9 ++++++---
 repos/templating.proj           |  3 ++-
 7 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/repos/application-insights.proj b/repos/application-insights.proj
index d9d56eb194..64dffe8ecb 100644
--- a/repos/application-insights.proj
+++ b/repos/application-insights.proj
@@ -18,14 +18,17 @@
 
     <Exec Command="$(DotnetToolCommand) restore /bl:restore.binlog $(BuildCommandArgs)  "
           EnvironmentVariables="@(EnvironmentVariables)"
-          WorkingDirectory="$(ProjectDirectory)" />
+          WorkingDirectory="$(ProjectDirectory)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <Exec Command="$(DotnetToolCommand) build /bl:build.binlog $(BuildCommandArgs)"
           EnvironmentVariables="@(EnvironmentVariables)"
-          WorkingDirectory="$(ProjectDirectory)" />
+          WorkingDirectory="$(ProjectDirectory)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <Exec Command="$(DotnetToolCommand) pack /bl:pack.binlog $(BuildCommandArgs)"
           EnvironmentVariables="@(EnvironmentVariables)"
-          WorkingDirectory="$(ProjectDirectory)" />
+          WorkingDirectory="$(ProjectDirectory)"
+          IgnoreStandardErrorWarningFormat="true" />
   </Target>
 </Project>
diff --git a/repos/dir.targets b/repos/dir.targets
index 761e7ae603..b3793b1d04 100644
--- a/repos/dir.targets
+++ b/repos/dir.targets
@@ -245,7 +245,10 @@
     <ItemGroup>
       <EnvironmentVariables Condition="'$(NUGET_PACKAGES)'!=''" Include="NUGET_PACKAGES=$(NUGET_PACKAGES)" />
     </ItemGroup>
-    <Exec Command="$(BuildCommand) $(RepoApiArgs) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
+    <Exec Command="$(BuildCommand) $(RepoApiArgs) $(RedirectRepoOutputToLog)"
+          WorkingDirectory="$(ProjectDirectory)"
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
   </Target>
 
   <Target Name="ReportRepoError">
@@ -261,7 +264,10 @@
     <Message Importance="High" Text="  Log: $(RepoConsoleLogFile)" />
     <Message Importance="High" Text="  With Environment Variables:" />
     <Message Importance="High" Text="    %(EnvironmentVariables.Identity)" />
-    <Exec Command="$(BuildPackagesCommand) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
+    <Exec Command="$(BuildPackagesCommand) $(RedirectRepoOutputToLog)"
+          WorkingDirectory="$(ProjectDirectory)"
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
     <Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Packaging $(ProjectBuildReason)...done" />
     <OnError ExecuteTargets="ReportRepoError" />
   </Target>
@@ -309,13 +315,10 @@
   </Target>
 
   <Target Name="Clean" Condition="'$(CleanCommand)' != ''" >
-    <Exec Command="$(CleanCommand) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
-  </Target>
-
-  <Target Name="Update"
-          BeforeTargets="Build"
-          Condition="'$(DependencyVersionInputRepoApiImplemented)' != 'true' AND '$(UpdateCommand)' != ''">
-    <Exec Command="$(UpdateCommand) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
+    <Exec Command="$(CleanCommand) $(RedirectRepoOutputToLog)"
+          WorkingDirectory="$(ProjectDirectory)"
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
   </Target>
 
   <Target Name="SetNuGetPackagesEnvironment" Condition="'$(ArchiveDownloadedPackages)' == 'true'">
diff --git a/repos/netcorecli-fsc.proj b/repos/netcorecli-fsc.proj
index c905cf9d81..0422eeb233 100644
--- a/repos/netcorecli-fsc.proj
+++ b/repos/netcorecli-fsc.proj
@@ -12,7 +12,8 @@
   <Target Name="Restore" BeforeTargets="Build" DependsOnTargets="UpdateNuGetConfig">
     <Exec Command="$(DotnetToolCommand) restore FSharp.NET.Sdk.csproj $(OutputArgs) $(RedirectRepoOutputToLog)"
           WorkingDirectory="$(ProjectDirectory)"
-          EnvironmentVariables="@(EnvironmentVariables)" />
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
   </Target>
 
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))/dir.targets" />
diff --git a/repos/newtonsoft-json.proj b/repos/newtonsoft-json.proj
index 073f725fa0..9ad089b05a 100644
--- a/repos/newtonsoft-json.proj
+++ b/repos/newtonsoft-json.proj
@@ -19,7 +19,8 @@
   <Target Name="Restore" BeforeTargets="Build" DependsOnTargets="UpdateNuGetConfig">
     <Exec Command="$(DotnetToolCommand) restore $(NewtonsoftJsonProjectPath) $(DotnetToolCommandArguments) $(RedirectRepoOutputToLog)"
           WorkingDirectory="$(ProjectDirectory)"
-          EnvironmentVariables="@(EnvironmentVariables)" />
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
   </Target>
 
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))/dir.targets" />
diff --git a/repos/nuget-client.proj b/repos/nuget-client.proj
index da135caa8a..d97f550d46 100644
--- a/repos/nuget-client.proj
+++ b/repos/nuget-client.proj
@@ -36,11 +36,13 @@
 
     <Exec Command="$(BuildCommandBase) /t:RestoreXPLAT /bl:restore.binlog $(RedirectRepoOutputToLog)"
           EnvironmentVariables="@(EnvironmentVariables)"
-          WorkingDirectory="$(ProjectDirectory)" />
+          WorkingDirectory="$(ProjectDirectory)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <Exec Command="$(BuildCommandBase) /t:BuildXPLAT /bl:build.binlog $(RedirectRepoOutputToLog)"
           EnvironmentVariables="@(EnvironmentVariables)"
-          WorkingDirectory="$(ProjectDirectory)" />
+          WorkingDirectory="$(ProjectDirectory)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <PropertyGroup>
       <PackCommand>$(BuildCommandBase) /t:PackXPlat</PackCommand>
@@ -53,7 +55,8 @@
 
     <Exec Command="$(PackCommand)"
           EnvironmentVariables="@(EnvironmentVariables)"
-          WorkingDirectory="$(ProjectDirectory)" />
+          WorkingDirectory="$(ProjectDirectory)"
+          IgnoreStandardErrorWarningFormat="true" />
   </Target>
 
   <Target Name="InitSubmodules" Condition="Exists('$(ProjectDirectory).git')">
diff --git a/repos/roslyn.proj b/repos/roslyn.proj
index 84d05915b2..5601e710cd 100644
--- a/repos/roslyn.proj
+++ b/repos/roslyn.proj
@@ -56,7 +56,8 @@
 
     <Exec Command="$(DotnetToolCommand) $(RestoreArgs)"
           WorkingDirectory="$(ProjectDirectory)"
-          EnvironmentVariables="@(EnvironmentVariables)" />
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring 'roslyn'...done" />
   </Target>
@@ -90,7 +91,8 @@
 
     <Exec Command="$(DotnetToolCommand) $(PublishCommandArgs) %(PublishWithoutBuildingProject.Identity) $(RedirectRepoOutputToLog)"
           WorkingDirectory="$(ProjectDirectory)"
-          EnvironmentVariables="@(EnvironmentVariables)" />
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <PropertyGroup>
       <PackCommandArgs>pack --no-build</PackCommandArgs>
@@ -104,7 +106,8 @@
 
     <Exec Command="$(DotnetToolCommand) $(PackCommandArgs) -p:NuspecFile=%(NuSpecFiles.Identity) $(RedirectRepoOutputToLog)"
           WorkingDirectory="$(ProjectDirectory)"
-          EnvironmentVariables="@(EnvironmentVariables)" />
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Packaging 'roslyn'...done" />
   </Target>
diff --git a/repos/templating.proj b/repos/templating.proj
index 568949f865..91a84908c6 100644
--- a/repos/templating.proj
+++ b/repos/templating.proj
@@ -38,7 +38,8 @@
 
     <Exec Command="$(DotnetToolCommand) msbuild $(BuildCommandArgs)"
           WorkingDirectory="$(ProjectDirectory)"
-          EnvironmentVariables="@(EnvironmentVariables)" />
+          EnvironmentVariables="@(EnvironmentVariables)"
+          IgnoreStandardErrorWarningFormat="true" />
 
     <!-- The templates are built to a different folder than the packages, copy them into the packages folder. -->
     <ItemGroup>