Skip to content

Commit c643b38

Browse files
committed
Add dotnet/roslyn-analyzers repo
This repo doesn't build out of the box on Linux, so I have added various build scripts and hacks to get that working.
1 parent 8d3666b commit c643b38

8 files changed

+1958
-0
lines changed

Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@
255255
<!-- Used by sdk to determine msbuild version for fsharp -->
256256
<ExtraPackageVersionPropsPackageInfo Include="FSharpBuildVersion" Version="%24(MicrosoftBuildPackageVersion)" />
257257

258+
<!-- Used by roslyn-analyzsers to determine rsolyn version -->
259+
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftCodeAnalysisForShippedApisVersion" Version="%24(MicrosoftCodeAnalysisVersion)" />
260+
<ExtraPackageVersionPropsPackageInfo Include="MicrosoftCodeAnalysisForRoslynDiagnosticsAnalyzersVersion" Version="%24(MicrosoftCodeAnalysisVersion)" />
261+
258262
<!-- property used by Arcade to determine what version of SourceLink to use -->
259263
<!-- if MicrosoftSourceLinkCommonPackageVersion is non-empty, then we've already built SourceLink, regardless of whether
260264
this is the production or offline build, so we should use that version. -->

eng/Version.Details.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
<Uri>https://github.com/dotnet/msbuild</Uri>
5555
<Sha>126527ff107ae93fed10af675506c56d046aa5a3</Sha>
5656
</Dependency>
57+
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.0" CoherentParentDependency="Microsoft.NET.Sdk">
58+
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
59+
<Sha>5c7721621bbab897c3ace6bf2c1489dda259eb9e</Sha>
60+
</Dependency>
5761
<Dependency Name="NuGet.Build.Tasks" Version="5.8.0-rc.6930" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
5862
<Uri>https://github.com/NuGet/NuGet.Client</Uri>
5963
<Sha>830c8be45dbbccd411ecf6080abff0c2c98079cf</Sha>

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

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

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

Lines changed: 374 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From f3f0b2eec1f707260718dbd6e44dfb785b7b5d82 Mon Sep 17 00:00:00 2001
2+
From: Omair Majid <[email protected]>
3+
Date: Fri, 6 Nov 2020 18:18:48 -0500
4+
Subject: [PATCH 3/4] Update Microsoft.CodeAnalysis packages
5+
6+
The version used in 5.0 SDK is Microsoft.CodeAnalysis 3.8.0
7+
---
8+
eng/Versions.props | 6 +++---
9+
1 file changed, 3 insertions(+), 3 deletions(-)
10+
11+
diff --git a/eng/Versions.props b/eng/Versions.props
12+
index ced06221d..677b44310 100644
13+
--- a/eng/Versions.props
14+
+++ b/eng/Versions.props
15+
@@ -24,10 +24,10 @@
16+
<!-- Use the correct compiler version -->
17+
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
18+
<!-- Roslyn -->
19+
- <MicrosoftCodeAnalysisVersion>3.3.1</MicrosoftCodeAnalysisVersion>
20+
- <MicrosoftCodeAnalysisCommonVersion>3.3.1</MicrosoftCodeAnalysisCommonVersion>
21+
+ <MicrosoftCodeAnalysisVersion>3.8.0</MicrosoftCodeAnalysisVersion>
22+
+ <MicrosoftCodeAnalysisCommonVersion>3.8.0</MicrosoftCodeAnalysisCommonVersion>
23+
<MicrosoftCodeAnalysisForRoslynDiagnosticsAnalyzersVersion>$(MicrosoftCodeAnalysisVersion)</MicrosoftCodeAnalysisForRoslynDiagnosticsAnalyzersVersion>
24+
- <MicrosoftCodeAnalysisForShippedApisVersion>3.7.0</MicrosoftCodeAnalysisForShippedApisVersion>
25+
+ <MicrosoftCodeAnalysisForShippedApisVersion>$(MicrosoftCodeAnalysisVersion)</MicrosoftCodeAnalysisForShippedApisVersion>
26+
<DogfoodAnalyzersVersion>3.3.0</DogfoodAnalyzersVersion>
27+
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>$(DogfoodAnalyzersVersion)</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
28+
<MicrosoftCodeAnalysisFXCopAnalyzersVersion>$(DogfoodAnalyzersVersion)</MicrosoftCodeAnalysisFXCopAnalyzersVersion>
29+
--
30+
2.26.2
31+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 1839e0370d5416b45f0a8fbcc370f4984237f1ba Mon Sep 17 00:00:00 2001
2+
From: Omair Majid <[email protected]>
3+
Date: Mon, 9 Nov 2020 11:52:28 -0500
4+
Subject: [PATCH 4/4] Fix version for Microsoft.CodeAnalysis.CSharp.CodeStyle
5+
6+
---
7+
eng/Versions.props | 2 +-
8+
src/Directory.Build.props | 2 +-
9+
2 files changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/eng/Versions.props b/eng/Versions.props
12+
index 677b44310..f9e213be1 100644
13+
--- a/eng/Versions.props
14+
+++ b/eng/Versions.props
15+
@@ -34,7 +34,7 @@
16+
<MicrosoftCodeAnalysisAnalyzersVersion>$(DogfoodAnalyzersVersion)</MicrosoftCodeAnalysisAnalyzersVersion>
17+
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>$(DogfoodAnalyzersVersion)</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
18+
<RoslynDiagnosticsAnalyzersVersion>$(DogfoodAnalyzersVersion)</RoslynDiagnosticsAnalyzersVersion>
19+
- <CodeStyleAnalyersVersion>3.8.0-2.20427.18</CodeStyleAnalyersVersion>
20+
+ <MicrosoftCodeAnalysisCSharpCodeStyleVersion>3.8.0-2.20427.18</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
21+
<MicrosoftCodeAnalysisTestResourcesProprietaryVersion>2.0.0-pre-20160714</MicrosoftCodeAnalysisTestResourcesProprietaryVersion>
22+
<!-- Roslyn Testing -->
23+
<MicrosoftCodeAnalysisTestingVersion>1.0.1-beta1.20374.2</MicrosoftCodeAnalysisTestingVersion>
24+
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
25+
index 24e9fe3eb..6c95f9d7b 100644
26+
--- a/src/Directory.Build.props
27+
+++ b/src/Directory.Build.props
28+
@@ -25,7 +25,7 @@
29+
30+
<!-- Code Style analyzers -->
31+
<ItemGroup Condition="'$(Language)' == 'C#'">
32+
- <PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="$(CodeStyleAnalyersVersion)" />
33+
+ <PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="$(MicrosoftCodeAnalysisCSharpCodeStyleVersion)" />
34+
</ItemGroup>
35+
<ItemGroup Condition="'$(Language)' == 'VB'">
36+
<!-- https://github.com/dotnet/roslyn-analyzers/issues/2095 tracks uncommenting the below -->
37+
--
38+
2.26.2
39+

repos/roslyn-analyzers.proj

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<Project>
2+
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
3+
4+
<PropertyGroup>
5+
<BuildCommandArgs>--restore --build --pack</BuildCommandArgs>
6+
<BuildCommandArgs>$(BuildCommandArgs) --configuration $(Configuration)</BuildCommandArgs>
7+
<BuildCommandArgs>$(BuildCommandArgs) -v $(LogVerbosity)</BuildCommandArgs>
8+
<BuildCommandArgs>$(BuildCommandArgs) -bl</BuildCommandArgs>
9+
<BuildCommandArgs>$(BuildCommandArgs) -warnaserror false</BuildCommandArgs>
10+
<BuildCommandArgs>$(BuildCommandArgs) /p:TreatWarningsAsErrors=false</BuildCommandArgs>
11+
12+
<!-- Versioning args. -->
13+
<BuildCommandArgs>$(BuildCommandArgs) /p:OfficialBuild=true</BuildCommandArgs>
14+
<BuildCommandArgs>$(BuildCommandArgs) /p:DotNetPackageVersionPropsPath=$(PackageVersionPropsPath)</BuildCommandArgs>
15+
<BuildCommandArgs>$(BuildCommandArgs) /p:DotNetBuildFromSource=true</BuildCommandArgs>
16+
<BuildCommandArgs>$(BuildCommandArgs) /p:GitHubRepositoryName=roslyn-analyzers</BuildCommandArgs>
17+
<BuildCommandArgs>$(BuildCommandArgs) /p:RepositoryUrl=git://github.com/dotnet/roslyn-analyzers</BuildCommandArgs>
18+
19+
<BuildCommand>$(ProjectDirectory)build$(ShellExtension) $(BuildCommandArgs)</BuildCommand>
20+
21+
<PackagesOutput>$(ProjectDirectory)artifacts/packages/$(Configuration)/Shipping/</PackagesOutput>
22+
<RepoApiImplemented>false</RepoApiImplemented>
23+
<DependencyVersionInputRepoApiImplemented>true</DependencyVersionInputRepoApiImplemented>
24+
<LogVerbosityOptOut>true</LogVerbosityOptOut>
25+
<GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
26+
</PropertyGroup>
27+
28+
<ItemGroup>
29+
<RepositoryReference Include="runtime" />
30+
<RepositoryReference Include="roslyn" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<UseSourceBuiltSdkOverride Include="@(ArcadeSdkOverride)" />
35+
</ItemGroup>
36+
37+
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
38+
</Project>

repos/sdk.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<RepositoryReference Include="newtonsoft-json" />
5555
<RepositoryReference Include="newtonsoft-json901" />
5656
<RepositoryReference Include="nuget-client" />
57+
<RepositoryReference Include="roslyn-analyzers" />
5758
<RepositoryReference Include="vstest" />
5859
<RepositoryReference Include="fsharp" />
5960
</ItemGroup>

0 commit comments

Comments
 (0)