Skip to content

Commit c827c3e

Browse files
authored
Set IgnoreStandardErrorWarningFormat on Execs (#869)
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.
1 parent d6afe95 commit c827c3e

File tree

7 files changed

+36
-21
lines changed

7 files changed

+36
-21
lines changed

repos/application-insights.proj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@
1818

1919
<Exec Command="$(DotnetToolCommand) restore /bl:restore.binlog $(BuildCommandArgs) "
2020
EnvironmentVariables="@(EnvironmentVariables)"
21-
WorkingDirectory="$(ProjectDirectory)" />
21+
WorkingDirectory="$(ProjectDirectory)"
22+
IgnoreStandardErrorWarningFormat="true" />
2223

2324
<Exec Command="$(DotnetToolCommand) build /bl:build.binlog $(BuildCommandArgs)"
2425
EnvironmentVariables="@(EnvironmentVariables)"
25-
WorkingDirectory="$(ProjectDirectory)" />
26+
WorkingDirectory="$(ProjectDirectory)"
27+
IgnoreStandardErrorWarningFormat="true" />
2628

2729
<Exec Command="$(DotnetToolCommand) pack /bl:pack.binlog $(BuildCommandArgs)"
2830
EnvironmentVariables="@(EnvironmentVariables)"
29-
WorkingDirectory="$(ProjectDirectory)" />
31+
WorkingDirectory="$(ProjectDirectory)"
32+
IgnoreStandardErrorWarningFormat="true" />
3033
</Target>
3134
</Project>

repos/dir.targets

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@
245245
<ItemGroup>
246246
<EnvironmentVariables Condition="'$(NUGET_PACKAGES)'!=''" Include="NUGET_PACKAGES=$(NUGET_PACKAGES)" />
247247
</ItemGroup>
248-
<Exec Command="$(BuildCommand) $(RepoApiArgs) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
248+
<Exec Command="$(BuildCommand) $(RepoApiArgs) $(RedirectRepoOutputToLog)"
249+
WorkingDirectory="$(ProjectDirectory)"
250+
EnvironmentVariables="@(EnvironmentVariables)"
251+
IgnoreStandardErrorWarningFormat="true" />
249252
</Target>
250253

251254
<Target Name="ReportRepoError">
@@ -261,7 +264,10 @@
261264
<Message Importance="High" Text=" Log: $(RepoConsoleLogFile)" />
262265
<Message Importance="High" Text=" With Environment Variables:" />
263266
<Message Importance="High" Text=" %(EnvironmentVariables.Identity)" />
264-
<Exec Command="$(BuildPackagesCommand) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
267+
<Exec Command="$(BuildPackagesCommand) $(RedirectRepoOutputToLog)"
268+
WorkingDirectory="$(ProjectDirectory)"
269+
EnvironmentVariables="@(EnvironmentVariables)"
270+
IgnoreStandardErrorWarningFormat="true" />
265271
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Packaging $(ProjectBuildReason)...done" />
266272
<OnError ExecuteTargets="ReportRepoError" />
267273
</Target>
@@ -309,13 +315,10 @@
309315
</Target>
310316

311317
<Target Name="Clean" Condition="'$(CleanCommand)' != ''" >
312-
<Exec Command="$(CleanCommand) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
313-
</Target>
314-
315-
<Target Name="Update"
316-
BeforeTargets="Build"
317-
Condition="'$(DependencyVersionInputRepoApiImplemented)' != 'true' AND '$(UpdateCommand)' != ''">
318-
<Exec Command="$(UpdateCommand) $(RedirectRepoOutputToLog)" WorkingDirectory="$(ProjectDirectory)" EnvironmentVariables="@(EnvironmentVariables)" />
318+
<Exec Command="$(CleanCommand) $(RedirectRepoOutputToLog)"
319+
WorkingDirectory="$(ProjectDirectory)"
320+
EnvironmentVariables="@(EnvironmentVariables)"
321+
IgnoreStandardErrorWarningFormat="true" />
319322
</Target>
320323

321324
<Target Name="SetNuGetPackagesEnvironment" Condition="'$(ArchiveDownloadedPackages)' == 'true'">

repos/netcorecli-fsc.proj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<Target Name="Restore" BeforeTargets="Build" DependsOnTargets="UpdateNuGetConfig">
1313
<Exec Command="$(DotnetToolCommand) restore FSharp.NET.Sdk.csproj $(OutputArgs) $(RedirectRepoOutputToLog)"
1414
WorkingDirectory="$(ProjectDirectory)"
15-
EnvironmentVariables="@(EnvironmentVariables)" />
15+
EnvironmentVariables="@(EnvironmentVariables)"
16+
IgnoreStandardErrorWarningFormat="true" />
1617
</Target>
1718

1819
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))/dir.targets" />

repos/newtonsoft-json.proj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<Target Name="Restore" BeforeTargets="Build" DependsOnTargets="UpdateNuGetConfig">
2020
<Exec Command="$(DotnetToolCommand) restore $(NewtonsoftJsonProjectPath) $(DotnetToolCommandArguments) $(RedirectRepoOutputToLog)"
2121
WorkingDirectory="$(ProjectDirectory)"
22-
EnvironmentVariables="@(EnvironmentVariables)" />
22+
EnvironmentVariables="@(EnvironmentVariables)"
23+
IgnoreStandardErrorWarningFormat="true" />
2324
</Target>
2425

2526
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))/dir.targets" />

repos/nuget-client.proj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636

3737
<Exec Command="$(BuildCommandBase) /t:RestoreXPLAT /bl:restore.binlog $(RedirectRepoOutputToLog)"
3838
EnvironmentVariables="@(EnvironmentVariables)"
39-
WorkingDirectory="$(ProjectDirectory)" />
39+
WorkingDirectory="$(ProjectDirectory)"
40+
IgnoreStandardErrorWarningFormat="true" />
4041

4142
<Exec Command="$(BuildCommandBase) /t:BuildXPLAT /bl:build.binlog $(RedirectRepoOutputToLog)"
4243
EnvironmentVariables="@(EnvironmentVariables)"
43-
WorkingDirectory="$(ProjectDirectory)" />
44+
WorkingDirectory="$(ProjectDirectory)"
45+
IgnoreStandardErrorWarningFormat="true" />
4446

4547
<PropertyGroup>
4648
<PackCommand>$(BuildCommandBase) /t:PackXPlat</PackCommand>
@@ -53,7 +55,8 @@
5355

5456
<Exec Command="$(PackCommand)"
5557
EnvironmentVariables="@(EnvironmentVariables)"
56-
WorkingDirectory="$(ProjectDirectory)" />
58+
WorkingDirectory="$(ProjectDirectory)"
59+
IgnoreStandardErrorWarningFormat="true" />
5760
</Target>
5861

5962
<Target Name="InitSubmodules" Condition="Exists('$(ProjectDirectory).git')">

repos/roslyn.proj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656

5757
<Exec Command="$(DotnetToolCommand) $(RestoreArgs)"
5858
WorkingDirectory="$(ProjectDirectory)"
59-
EnvironmentVariables="@(EnvironmentVariables)" />
59+
EnvironmentVariables="@(EnvironmentVariables)"
60+
IgnoreStandardErrorWarningFormat="true" />
6061

6162
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring 'roslyn'...done" />
6263
</Target>
@@ -90,7 +91,8 @@
9091

9192
<Exec Command="$(DotnetToolCommand) $(PublishCommandArgs) %(PublishWithoutBuildingProject.Identity) $(RedirectRepoOutputToLog)"
9293
WorkingDirectory="$(ProjectDirectory)"
93-
EnvironmentVariables="@(EnvironmentVariables)" />
94+
EnvironmentVariables="@(EnvironmentVariables)"
95+
IgnoreStandardErrorWarningFormat="true" />
9496

9597
<PropertyGroup>
9698
<PackCommandArgs>pack --no-build</PackCommandArgs>
@@ -104,7 +106,8 @@
104106

105107
<Exec Command="$(DotnetToolCommand) $(PackCommandArgs) -p:NuspecFile=%(NuSpecFiles.Identity) $(RedirectRepoOutputToLog)"
106108
WorkingDirectory="$(ProjectDirectory)"
107-
EnvironmentVariables="@(EnvironmentVariables)" />
109+
EnvironmentVariables="@(EnvironmentVariables)"
110+
IgnoreStandardErrorWarningFormat="true" />
108111

109112
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Packaging 'roslyn'...done" />
110113
</Target>

repos/templating.proj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838

3939
<Exec Command="$(DotnetToolCommand) msbuild $(BuildCommandArgs)"
4040
WorkingDirectory="$(ProjectDirectory)"
41-
EnvironmentVariables="@(EnvironmentVariables)" />
41+
EnvironmentVariables="@(EnvironmentVariables)"
42+
IgnoreStandardErrorWarningFormat="true" />
4243

4344
<!-- The templates are built to a different folder than the packages, copy them into the packages folder. -->
4445
<ItemGroup>

0 commit comments

Comments
 (0)