Skip to content

Commit 138b3f7

Browse files
authored
Switch to upstream patches for roslyn-analyzers (#1902)
This reduces the size/complexity of the "WIP for source-build" patch by adding individual patches that were merged into roslyn-analyzers: - dotnet/roslyn-analyzers#4419 - dotnet/roslyn-analyzers#4436 As part of that, it replaces an Exec-dotnet with MSBuild call, which should fix the build flakiness with GenerateAnalyzerNuspec.deps.json. Fixes: #1900
1 parent 28f73b9 commit 138b3f7

8 files changed

+753
-808
lines changed

patches/roslyn-analyzers/0001-WIP-for-source-build.patch

Lines changed: 0 additions & 784 deletions
Large diffs are not rendered by default.

patches/roslyn-analyzers/0002-Enable-building-on-Linux.patch

Lines changed: 515 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
From fed5a94a2b5a39d227b9337c22d5ac2f91288904 Mon Sep 17 00:00:00 2001
2+
From: Omair Majid <[email protected]>
3+
Date: Tue, 17 Nov 2020 19:14:37 -0500
4+
Subject: [PATCH] Fix ./build.sh --pack to work on Linux
5+
6+
There's no csi.exe in the .NET 5 (or .NET Core) SDK. So move away from
7+
a csx script to a full-blown tool written in C#.
8+
9+
For ease of review, I have kept the original tool code unmodified (not
10+
even indentation has been fixed). To work around build warnings/errors,
11+
disable the warnings.
12+
13+
Also fix the case of path to the dll in the local nuget cache. It
14+
doesn't matter on Windows, but most file systems on Linux are
15+
case-sensitive.
16+
---
17+
eng/GenerateAnalyzerNuspec.targets | 23 +++++++++++--------
18+
...osoft.CodeQuality.Analyzers.Package.csproj | 4 ++--
19+
.../GenerateAnalyzerNuspec.csproj | 7 ++++++
20+
.../Tools/GenerateAnalyzerNuspec/Program.cs | 19 +++++++++++++--
21+
4 files changed, 39 insertions(+), 14 deletions(-)
22+
create mode 100644 src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj
23+
rename eng/GenerateAnalyzerNuspec.csx => src/Tools/GenerateAnalyzerNuspec/Program.cs (96%)
24+
25+
diff --git a/eng/GenerateAnalyzerNuspec.targets b/eng/GenerateAnalyzerNuspec.targets
26+
index 9b90519cf..74244690a 100644
27+
--- a/eng/GenerateAnalyzerNuspec.targets
28+
+++ b/eng/GenerateAnalyzerNuspec.targets
29+
@@ -22,6 +22,12 @@
30+
<PackageLicenseExpression Condition="'$(PackageLicenseExpression)' == ''">Apache-2.0</PackageLicenseExpression>
31+
</PropertyGroup>
32+
33+
+ <PropertyGroup>
34+
+ <DotNetExecutable Condition="'$(OS)' == 'Windows_NT'">$(DotNetRoot)dotnet.exe</DotNetExecutable>
35+
+ <DotNetExecutable Condition="'$(DotNetExecutable)' == ''">$(DotNetRoot)dotnet</DotNetExecutable>
36+
+ <EscapeDirectorySuffix Condition="'$(OS)' == 'Windows_NT'">\</EscapeDirectorySuffix>
37+
+ </PropertyGroup>
38+
+
39+
<Target Name="GenerateAnalyzerConfigAndDocumentationFiles"
40+
DependsOnTargets="InitializeSourceControlInformation"
41+
Condition="'@(AnalyzerNupkgAssembly)' != '' or '@(AnalyzerRulesetAssembly)' != ''">
42+
@@ -88,13 +88,13 @@
43+
<AnalyzerRulesetAssembly Condition="'@(AnalyzerNupkgAssembly)' != '' and '@(AnalyzerRulesetAssembly)' == ''" Include="@(AnalyzerNupkgAssembly)"/>
44+
<AnalyzerRulesetAssembly Update="@(AnalyzerRulesetAssembly)" Condition="'%(AnalyzerRulesetAssembly.TargetFramework)' == ''" TargetFramework="$(TargetFramework)" />
45+
</ItemGroup>
46+
- <Exec Command='"$(DotNetRoot)dotnet.exe" "$(_GenerateDocumentationAndConfigFilesPath)" "$(_GeneratedRulesetsDir)" "$(_GeneratedEditorconfigsDir)" "$(ArtifactsBinDir)\" "$(Configuration)" "%(AnalyzerRulesetAssembly.TargetFramework)" "@(AnalyzerRulesetAssembly)" "$(PackagePropsFileDir)" "$(PackagePropsFileName)" "$(DisableNETAnalyzersPackagePropsFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerDocumentationFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerSarifFileName)" "$(VersionPrefix)" $(NuspecPackageId) $(ContainsPortedFxCopRules) $(GenerateAnalyzerRulesMissingDocumentationFile)' />
47+
+ <Exec Command='"$(DotNetExecutable)" "$(_GenerateDocumentationAndConfigFilesPath)" "$(_GeneratedRulesetsDir)" "$(_GeneratedEditorconfigsDir)" "$(ArtifactsBinDir)$(EscapeDirectorySuffix)" "$(Configuration)" "%(AnalyzerRulesetAssembly.TargetFramework)" "@(AnalyzerRulesetAssembly)" "$(PackagePropsFileDir)" "$(PackagePropsFileName)" "$(DisableNETAnalyzersPackagePropsFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerDocumentationFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerSarifFileName)" "$(VersionPrefix)" $(NuspecPackageId) $(ContainsPortedFxCopRules) $(GenerateAnalyzerRulesMissingDocumentationFile)' />
48+
49+
<MSBuild Projects="$(RepoRoot)src\Tools\GenerateGlobalAnalyzerConfigs\GenerateGlobalAnalyzerConfigs.csproj" Targets="Build">
50+
<Output TaskParameter="TargetOutputs" PropertyName="_GenerateGlobalAnalyzerConfigsPath"/>
51+
</MSBuild>
52+
53+
- <Exec Command='"$(DotNetRoot)dotnet.exe" "$(_GenerateGlobalAnalyzerConfigsPath)" "$(_GeneratedGlobalAnalyzerConfigsDir)" "$(NuspecPackageId)" "$(PackageTargetsFileDir)" "$(PackageTargetsFileName)" "@(AnalyzerRulesetAssembly)" "$(ArtifactsBinDir)\" "$(Configuration)" "%(AnalyzerRulesetAssembly.TargetFramework)" "$(ReleaseTrackingOptOut)"' />
54+
+ <Exec Command='"$(DotNetExecutable)" "$(_GenerateGlobalAnalyzerConfigsPath)" "$(_GeneratedGlobalAnalyzerConfigsDir)" "$(NuspecPackageId)" "$(PackageTargetsFileDir)" "$(PackageTargetsFileName)" "@(AnalyzerRulesetAssembly)" "$(ArtifactsBinDir)$(EscapeDirectorySuffix)" "$(Configuration)" "%(AnalyzerRulesetAssembly.TargetFramework)" "$(ReleaseTrackingOptOut)"' />
55+
56+
<ItemGroup Condition="Exists('$(PackageTargetsFileDir)\$(PackageTargetsFileName)')">
57+
<AnalyzerNupkgFile Include="$(PackageTargetsFileDir)\$(PackageTargetsFileName)"/>
58+
@@ -131,13 +137,10 @@
59+
<_NuspecMetadata Include="repositoryUrl=$(PrivateRepositoryUrl)" />
60+
</ItemGroup>
61+
62+
- <PropertyGroup>
63+
- <_CscToolPath>$(RoslynTargetsPath)</_CscToolPath>
64+
- <_CscToolPath Condition="'$(_CscToolPath)' == ''">$(CscToolPath)</_CscToolPath>
65+
- <_CscToolPath Condition="'$(_CscToolPath)' == ''">$(MSBuildBinPath)\Roslyn</_CscToolPath>
66+
- <_CscToolPath Condition="!HasTrailingSlash('$(_CscToolPath)')">$(_CscToolPath)\</_CscToolPath>
67+
- </PropertyGroup>
68+
+ <MSBuild Projects="$(RepoRoot)src\Tools\GenerateAnalyzerNuspec\GenerateAnalyzerNuspec.csproj" Targets="Restore;Build">
69+
+ <Output TaskParameter="TargetOutputs" PropertyName="_GenerateAnalyzerNuspecPath"/>
70+
+ </MSBuild>
71+
72+
- <Exec Command='"$(_CscToolPath)csi.exe" "$(RepoRoot)eng\GenerateAnalyzerNuspec.csx" "$(NuspecFile)" "$(AssetsDir)\" "$(MSBuildProjectDirectory)" "$(Configuration)" "$(TargetFrameworksForPackage)" "@(_NuspecMetadata)" "@(AnalyzerNupkgFile)" "@(AnalyzerNupkgFolder)" "@(AnalyzerNupkgAssembly)" "@(AnalyzerNupkgDependency)" "@(AnalyzerNupkgLibrary)" "$(_GeneratedRulesetsDir)" "$(_GeneratedEditorconfigsDir)" "@(AnalyzerLegacyRuleset)" "$(ArtifactsBinDir)\" "$(AnalyzerDocumentationFileDir)" "$(AnalyzerDocumentationFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerSarifFileName)" "$(AnalyzerConfigurationFileDir)" "$(AnalyzerConfigurationFileName)" "$(_GeneratedGlobalAnalyzerConfigsDir)"' />
73+
+ <Exec Command='"$(DotNetExecutable)" "$(_GenerateAnalyzerNuspecPath)" "$(NuspecFile)" "$(AssetsDir)$(EscapeDirectorySuffix)" "$(MSBuildProjectDirectory)" "$(Configuration)" "$(TargetFrameworksForPackage)" "@(_NuspecMetadata)" "@(AnalyzerNupkgFile)" "@(AnalyzerNupkgFolder)" "@(AnalyzerNupkgAssembly)" "@(AnalyzerNupkgDependency)" "@(AnalyzerNupkgLibrary)" "$(_GeneratedRulesetsDir)" "$(_GeneratedEditorconfigsDir)" "@(AnalyzerLegacyRuleset)" "$(ArtifactsBinDir)$(EscapeDirectorySuffix)" "$(AnalyzerDocumentationFileDir)" "$(AnalyzerDocumentationFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerSarifFileName)" "$(AnalyzerConfigurationFileDir)" "$(AnalyzerConfigurationFileName)" "$(_GeneratedGlobalAnalyzerConfigsDir)"' />
74+
</Target>
75+
-</Project>
76+
\ No newline at end of file
77+
+</Project>
78+
diff --git a/nuget/Microsoft.CodeQuality.Analyzers/Microsoft.CodeQuality.Analyzers.Package.csproj b/nuget/Microsoft.CodeQuality.Analyzers/Microsoft.CodeQuality.Analyzers.Package.csproj
79+
index 397f6484c..65728e66a 100644
80+
--- a/nuget/Microsoft.CodeQuality.Analyzers/Microsoft.CodeQuality.Analyzers.Package.csproj
81+
+++ b/nuget/Microsoft.CodeQuality.Analyzers/Microsoft.CodeQuality.Analyzers.Package.csproj
82+
@@ -18,7 +18,7 @@
83+
<AnalyzerNupkgAssembly Include="Microsoft.CodeQuality.Analyzers.dll" />
84+
<AnalyzerNupkgAssembly Include="Microsoft.CodeQuality.CSharp.Analyzers.dll" />
85+
<AnalyzerNupkgAssembly Include="Microsoft.CodeQuality.VisualBasic.Analyzers.dll" />
86+
- <AnalyzerNupkgAssembly Include="$(NuGetPackageRoot)Humanizer.Core\$(HumanizerVersion)\lib\netstandard1.0\Humanizer.dll" />
87+
+ <AnalyzerNupkgAssembly Include="$(NuGetPackageRoot)humanizer.core\$(HumanizerVersion)\lib\netstandard1.0\Humanizer.dll" />
88+
</ItemGroup>
89+
90+
<ItemGroup>
91+
@@ -26,4 +26,4 @@
92+
<ProjectReference Include="..\..\src\NetAnalyzers\CSharp\Microsoft.CodeQuality.Analyzers\Microsoft.CodeQuality.CSharp.Analyzers.csproj" />
93+
<ProjectReference Include="..\..\src\NetAnalyzers\VisualBasic\Microsoft.CodeQuality.Analyzers\Microsoft.CodeQuality.VisualBasic.Analyzers.vbproj" />
94+
</ItemGroup>
95+
-</Project>
96+
\ No newline at end of file
97+
+</Project>
98+
diff --git a/src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj b/src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj
99+
new file mode 100644
100+
index 000000000..42b47952b
101+
--- /dev/null
102+
+++ b/src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj
103+
@@ -0,0 +1,7 @@
104+
+<Project Sdk="Microsoft.NET.Sdk">
105+
+ <PropertyGroup>
106+
+ <OutputType>Exe</OutputType>
107+
+ <TargetFramework>netcoreapp3.1</TargetFramework>
108+
+ <NonShipping>true</NonShipping>
109+
+ </PropertyGroup>
110+
+</Project>
111+
diff --git a/eng/GenerateAnalyzerNuspec.csx b/src/Tools/GenerateAnalyzerNuspec/Program.cs
112+
similarity index 96%
113+
rename from eng/GenerateAnalyzerNuspec.csx
114+
rename to src/Tools/GenerateAnalyzerNuspec/Program.cs
115+
index 1d40d0096..5ca8fbfcc 100644
116+
--- a/eng/GenerateAnalyzerNuspec.csx
117+
+++ b/src/Tools/GenerateAnalyzerNuspec/Program.cs
118+
@@ -1,5 +1,17 @@
119+
-using System.Diagnostics;
120+
+#pragma warning disable CA1820, CS8600, IDE0055, IDE0057, IDE0062, IDE0078, IDE0073
121+
+
122+
+using System;
123+
+using System.Collections.Generic;
124+
using System.IO;
125+
+using System.Linq;
126+
+using System.Text;
127+
+
128+
+namespace GenerateAnalyzerNuspec
129+
+{
130+
+ public static class Program
131+
+ {
132+
+ public static void Main(string[] Args)
133+
+ {
134+
135+
string nuspecFile = Args[0];
136+
string assetsDir = Args[1];
137+
@@ -280,4 +292,7 @@
138+
139+
result.AppendLine(@"</package>");
140+
141+
-File.WriteAllText(nuspecFile, result.ToString());
142+
\ No newline at end of file
143+
+File.WriteAllText(nuspecFile, result.ToString());
144+
+ }
145+
+ }
146+
+}
147+
--
148+
2.26.2
149+

patches/roslyn-analyzers/0002-Update-to-netstandard2.0.patch renamed to patches/roslyn-analyzers/0004-Update-to-netstandard2.0.patch

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,17 @@ diff --git a/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/Core/Microsoft.CodeAn
125125
index f3a0b0e5f..b8c947767 100644
126126
--- a/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/Core/Microsoft.CodeAnalysis.BannedApiAnalyzers.csproj
127127
+++ b/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/Core/Microsoft.CodeAnalysis.BannedApiAnalyzers.csproj
128-
@@ -1,7 +1,7 @@
128+
@@ -1,13 +1,15 @@
129129
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
130130
<Project Sdk="Microsoft.NET.Sdk">
131131
<PropertyGroup>
132132
- <TargetFramework>netstandard1.3</TargetFramework>
133133
+ <TargetFramework>netstandard2.0</TargetFramework>
134134
<!--
135-
PackageId is used by Restore. If we set it to Microsoft.CodeAnalysis.Analyzers,
136-
Restore would conclude that there is a cyclic dependency between Microsoft.CodeAnalysis and
137-
@@ -13,7 +13,9 @@
138-
about where the package name ends and where the version begins.
135+
PackageId is used by Restore. If we set it to Microsoft.CodeAnalysis.BannedApiAnalyzer,
136+
Restore would conclude that there is a cyclic dependency between us and the Microsoft.CodeAnalysis.BannedApiAnalyzer package.
139137
-->
140-
<PackageId>*$(MSBuildProjectFullPath.Replace('/', '\\'))*</PackageId>
138+
<PackageId>*$(MSBuildProjectFile)*</PackageId>
141139
+ <!--
142140
<MicrosoftCodeAnalysisVersion>2.9.0</MicrosoftCodeAnalysisVersion>
143141
+ -->
@@ -200,19 +198,17 @@ diff --git a/src/PerformanceSensitiveAnalyzers/Core/Microsoft.CodeAnalysis.Perfo
200198
index ac9455cac..366db8ae4 100644
201199
--- a/src/PerformanceSensitiveAnalyzers/Core/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers.csproj
202200
+++ b/src/PerformanceSensitiveAnalyzers/Core/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers.csproj
203-
@@ -1,7 +1,7 @@
201+
@@ -1,13 +1,15 @@
204202
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
205203
<Project Sdk="Microsoft.NET.Sdk">
206204
<PropertyGroup>
207205
- <TargetFramework>netstandard1.3</TargetFramework>
208206
+ <TargetFramework>netstandard2.0</TargetFramework>
209207
<!--
210-
PackageId is used by Restore. If we set it to Microsoft.CodeAnalysis.Analyzers,
211-
Restore would conclude that there is a cyclic dependency between Microsoft.CodeAnalysis and
212-
@@ -13,7 +13,9 @@
213-
about where the package name ends and where the version begins.
208+
PackageId is used by Restore. If we set it to Microsoft.CodeAnalysis.PerformanceSensitive.Analyzers,
209+
Restore would conclude that there is a cyclic dependency between us and the Microsoft.CodeAnalysis.PerformanceSensitive.Analyzers nuget package.
214210
-->
215-
<PackageId>*$(MSBuildProjectFullPath.Replace('/', '\\'))*</PackageId>
211+
<PackageId>*$(MSBuildProjectFile)*</PackageId>
216212
+ <!--
217213
<MicrosoftCodeAnalysisVersion>2.9.0</MicrosoftCodeAnalysisVersion>
218214
+ -->
@@ -263,19 +259,17 @@ diff --git a/src/PublicApiAnalyzers/Core/Analyzers/Microsoft.CodeAnalysis.Public
263259
index 8ac0061a4..ba8bac56e 100644
264260
--- a/src/PublicApiAnalyzers/Core/Analyzers/Microsoft.CodeAnalysis.PublicApiAnalyzers.csproj
265261
+++ b/src/PublicApiAnalyzers/Core/Analyzers/Microsoft.CodeAnalysis.PublicApiAnalyzers.csproj
266-
@@ -1,7 +1,7 @@
262+
@@ -1,13 +1,15 @@
267263
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
268264
<Project Sdk="Microsoft.NET.Sdk">
269265
<PropertyGroup>
270266
- <TargetFramework>netstandard1.3</TargetFramework>
271267
+ <TargetFramework>netstandard2.0</TargetFramework>
272268
<!--
273-
PackageId is used by Restore. If we set it to Microsoft.CodeAnalysis.Analyzers,
274-
Restore would conclude that there is a cyclic dependency between Microsoft.CodeAnalysis and
275-
@@ -13,7 +13,9 @@
276-
about where the package name ends and where the version begins.
269+
PackageId is used by Restore. If we set it to Microsoft.CodeAnalysis.PublicApiAnalyzer,
270+
Restore would conclude that there is a cyclic dependency between us and the Microsoft.CodeAnalysis.PublicApiAnalyzer package.
277271
-->
278-
<PackageId>*$(MSBuildProjectFullPath.Replace('/', '\\'))*</PackageId>
272+
<PackageId>*$(MSBuildProjectFile)*</PackageId>
279273
+ <!--
280274
<MicrosoftCodeAnalysisVersion>1.2.1</MicrosoftCodeAnalysisVersion>
281275
+ -->
@@ -330,19 +324,17 @@ diff --git a/src/PublicApiAnalyzers/Core/CodeFixes/Microsoft.CodeAnalysis.Public
330324
index bdb00b382..3178f5d2b 100644
331325
--- a/src/PublicApiAnalyzers/Core/CodeFixes/Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes.csproj
332326
+++ b/src/PublicApiAnalyzers/Core/CodeFixes/Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes.csproj
333-
@@ -1,7 +1,7 @@
327+
@@ -1,13 +1,15 @@
334328
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
335329
<Project Sdk="Microsoft.NET.Sdk">
336330
<PropertyGroup>
337331
- <TargetFramework>netstandard1.3</TargetFramework>
338332
+ <TargetFramework>netstandard2.0</TargetFramework>
339333
<!--
340-
PackageId is used by Restore. If we set it to Microsoft.CodeAnalysis.Analyzers,
341-
Restore would conclude that there is a cyclic dependency between Microsoft.CodeAnalysis and
342-
@@ -13,7 +13,9 @@
343-
about where the package name ends and where the version begins.
334+
PackageId is used by Restore. If we set it to DotNetAnalyzers.PublicApiAnalyzer.CodeFixes,
335+
Restore would conclude that there is a cyclic dependency between us and the DotNetAnalyzers.PublicApiAnalyzer.CodeFixes package.
344336
-->
345-
<PackageId>*$(MSBuildProjectFullPath.Replace('/', '\\'))*</PackageId>
337+
<PackageId>*$(MSBuildProjectFile)*</PackageId>
346338
+ <!--
347339
<MicrosoftCodeAnalysisVersion>1.2.1</MicrosoftCodeAnalysisVersion>
348340
+ -->
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
From 8e4efb29244e1673b8ac84394158a98d394b7e5f Mon Sep 17 00:00:00 2001
2+
From: Omair Majid <[email protected]>
3+
Date: Fri, 20 Nov 2020 13:00:40 -0500
4+
Subject: [PATCH] Reduce rebuilding GenerateAnalyzerNuspec.csproj
5+
6+
PR #4442 has reports where the build fails because the project is being
7+
rebuilt multiple time with highly parallel builds and that causes file
8+
conflicts.
9+
10+
I am not sure why that's happening, to be honest. Or at least why it's
11+
only happening for GenerateAnalyzerNuspec. That project uses the
12+
`MSBuild` + `Exec` pattern:
13+
14+
https://github.com/dotnet/roslyn-analyzers/blob/37eba3a5aa2d706745f37692ad7ba7cb0a66a115/eng/GenerateAnalyzerNuspec.targets#L140-L144
15+
16+
That's the same pattern used elsewhere in the same file:
17+
18+
https://github.com/dotnet/roslyn-analyzers/blob/37eba3a5aa2d706745f37692ad7ba7cb0a66a115/eng/GenerateAnalyzerNuspec.targets#L105-L109
19+
20+
Still, this PR tries to reduce how many times that project is rebuilt,
21+
which should (hopefully) reduce the frequency of the error, if not
22+
eliminate it.
23+
24+
Any suggestions on what could be causing this specifically in
25+
GenerateAnalyzerNuspec?
26+
---
27+
eng/GenerateAnalyzerNuspec.targets | 21 ++++++++++++++++-----
28+
1 file changed, 16 insertions(+), 5 deletions(-)
29+
30+
diff --git a/eng/GenerateAnalyzerNuspec.targets b/eng/GenerateAnalyzerNuspec.targets
31+
index 74244690a..b7210a770 100644
32+
--- a/eng/GenerateAnalyzerNuspec.targets
33+
+++ b/eng/GenerateAnalyzerNuspec.targets
34+
@@ -113,9 +113,24 @@
35+
</ItemGroup>
36+
</Target>
37+
38+
+ <PropertyGroup>
39+
+ <!-- Ideally, we would extract this from the MSBuild task, but we need this as the Target Output before that task is executed -->
40+
+ <_GenerateAnalyzerNuspecPath>$(ArtifactsBinDir)GenerateAnalyzerNuspec\$(Configuration)\netcoreapp3.1\GenerateAnalyzerNuspec.dll</_GenerateAnalyzerNuspecPath>
41+
+ </PropertyGroup>
42+
+
43+
+ <Target Name="BuildGenerateAnalyzerNuspecFile"
44+
+ Inputs="$(RepoRoot)src\Tools\GenerateAnalyzerNuspec\Program.cs"
45+
+ Outputs="$(_GenerateAnalyzerNuspecPath)">
46+
+
47+
+ <MSBuild Projects="$(RepoRoot)src\Tools\GenerateAnalyzerNuspec\GenerateAnalyzerNuspec.csproj"
48+
+ Targets="Restore;Build" >
49+
+ </MSBuild>
50+
+
51+
+ </Target>
52+
+
53+
<Target Name="GenerateAnalyzerNuspecFile"
54+
BeforeTargets="GenerateNuspec"
55+
- DependsOnTargets="InitializeSourceControlInformation;GenerateAnalyzerConfigAndDocumentationFiles"
56+
+ DependsOnTargets="InitializeSourceControlInformation;GenerateAnalyzerConfigAndDocumentationFiles;BuildGenerateAnalyzerNuspecFile"
57+
Condition="'@(AnalyzerNupkgFile)' != '' or '@(AnalyzerNupkgFolder)' != '' or '@(AnalyzerNupkgAssembly)' != '' or '@(AnalyzerNupkgDependency)' != '' or '@(AnalyzerNupkgLibrary)' != ''">
58+
<ItemGroup>
59+
<_NuspecMetadata Include="version=$(PackageVersion)" />
60+
@@ -137,10 +152,6 @@
61+
<_NuspecMetadata Include="repositoryUrl=$(PrivateRepositoryUrl)" />
62+
</ItemGroup>
63+
64+
- <MSBuild Projects="$(RepoRoot)src\Tools\GenerateAnalyzerNuspec\GenerateAnalyzerNuspec.csproj" Targets="Restore;Build">
65+
- <Output TaskParameter="TargetOutputs" PropertyName="_GenerateAnalyzerNuspecPath"/>
66+
- </MSBuild>
67+
-
68+
<Exec Command='"$(DotNetExecutable)" "$(_GenerateAnalyzerNuspecPath)" "$(NuspecFile)" "$(AssetsDir)$(EscapeDirectorySuffix)" "$(MSBuildProjectDirectory)" "$(Configuration)" "$(TargetFrameworksForPackage)" "@(_NuspecMetadata)" "@(AnalyzerNupkgFile)" "@(AnalyzerNupkgFolder)" "@(AnalyzerNupkgAssembly)" "@(AnalyzerNupkgDependency)" "@(AnalyzerNupkgLibrary)" "$(_GeneratedRulesetsDir)" "$(_GeneratedEditorconfigsDir)" "@(AnalyzerLegacyRuleset)" "$(ArtifactsBinDir)$(EscapeDirectorySuffix)" "$(AnalyzerDocumentationFileDir)" "$(AnalyzerDocumentationFileName)" "$(AnalyzerSarifFileDir)" "$(AnalyzerSarifFileName)" "$(AnalyzerConfigurationFileDir)" "$(AnalyzerConfigurationFileName)" "$(_GeneratedGlobalAnalyzerConfigsDir)"' />
69+
</Target>
70+
</Project>
71+
--
72+
2.28.0
73+

0 commit comments

Comments
 (0)