[main] Onboard roslyn-analyzers and aspnetcore to source-build (#13830)

This commit is contained in:
Logan Bussell 2022-05-13 13:24:06 -07:00 committed by GitHub
parent b648ad31b1
commit b555f1cb54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "7.0.100-preview.3.22179.4"
"dotnet": "7.0.100-preview.5.22258.1"
},
"msbuild-sdks": {
"Microsoft.Build.CentralPackageVersions": "2.0.1",

View file

@ -33,7 +33,7 @@
<!-- Tier 1 -->
<RepositoryReference Include="command-line-api" />
<RepositoryReference Include="diagnostics" />
<RepositoryReference Include="razor-compiler" />
<!-- <RepositoryReference Include="razor-compiler" /> -->
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="source-build-externals" />
<RepositoryReference Include="symreader" />
@ -47,10 +47,10 @@
<RepositoryReference Include="runtime" />
<!-- Tier 3 -->
<!-- <RepositoryReference Include="roslyn-analyzers" /> -->
<RepositoryReference Include="roslyn-analyzers" />
<!-- Tier 4 -->
<!-- <RepositoryReference Include="aspnetcore" /> -->
<RepositoryReference Include="aspnetcore" />
<RepositoryReference Include="deployment-tools" />
<!-- <RepositoryReference Include="format" /> -->
<RepositoryReference Include="nuget-client" />

View file

@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Logan Bussell <loganbussell@microsoft.com>
Date: Thu, 12 May 2022 14:32:59 -0700
Subject: [PATCH] Disable warning CS0618
This is needed because IOperation.Children is deprecated in
Microsoft.CodeAnalysis 4.3.0, but aspnetcore references version 4.2.0.
---
.../src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj b/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj
index 0b94ad2a8f..1b5cb9d907 100644
--- a/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj
+++ b/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj
@@ -9,6 +9,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
+ <NoWarn>$(NoWarn);CS0618</NoWarn>
</PropertyGroup>
<ItemGroup>

View file

@ -7,7 +7,7 @@ Subject: [PATCH] Eliminate pre-built assets during source-build for
This is taking the approach used in previous versions of source-build: update the dependency versions of Microsoft.CodeAnalysis to the version currently being built by source-build. This is a short-term solution to get unblocked in the 6.0.0 timeframe. In the future, the previous Microsoft.CodeAnalysis versions will be available in SBRP.
* Remove SourceBuildPackageVersionPropsPath at the top of Versions.props. The PVP from source-build will be imported after the repo's Versions.props
* Workaround a naming collison with DocumentBasedFixAllProvider. The latest Roslyn has a class with the same name.
* Workaround naming collisions with DocumentBasedFixAllProvider. The latest Roslyn has a class with the same name.
* Remove hard-coded versions to Microsoft.CodeAnalysis in ResxSourceGenerator, Roslyn.Diagnostics.Analyzers, and GenerateDocumentationAndConfigFiles, so the latest gets picked up.
* Exclude ReleaseNotesUtil from source-build since it brings in the 3.1 app host. This tool shouldn't be needed during source-build.
* Disable BannedApiAnalyzers when in source-build. Other previously built code analysis packages are disabled already.
@ -21,6 +21,7 @@ Contributes to https://github.com/dotnet/source-build/issues/2527
....CodeAnalysis.ResxSourceGenerator.CSharp.csproj | 1 -
...Analysis.ResxSourceGenerator.VisualBasic.csproj | 1 -
...crosoft.CodeAnalysis.ResxSourceGenerator.csproj | 1 -
...harpDisableRuntimeMarshalling.FixAllProvider.cs | 2 +-
.../DoNotDirectlyAwaitATask.Fixer.cs | 2 +-
.../Roslyn.Diagnostics.CSharp.Analyzers.csproj | 2 +-
.../Core/Roslyn.Diagnostics.Analyzers.csproj | 1 -
@ -28,10 +29,10 @@ Contributes to https://github.com/dotnet/source-build/issues/2527
.../GenerateDocumentationAndConfigFiles.csproj | 1 -
...umentationAndConfigFilesForBrokenRuntime.csproj | 4 +---
src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj | 1 +
13 files changed, 9 insertions(+), 28 deletions(-)
14 files changed, 10 insertions(+), 29 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 46d30b3bd..635f8bb5c 100644
index a467fb579..acd5db8bc 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -1,18 +1,4 @@
@ -118,11 +119,24 @@ index 46a4fca6b..c9fa15584 100644
</PropertyGroup>
<ItemGroup>
diff --git a/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDisableRuntimeMarshalling.FixAllProvider.cs b/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDisableRuntimeMarshalling.FixAllProvider.cs
index 4bb27f03d..6d93ac3f7 100644
--- a/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDisableRuntimeMarshalling.FixAllProvider.cs
+++ b/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDisableRuntimeMarshalling.FixAllProvider.cs
@@ -15,7 +15,7 @@ namespace Microsoft.NetCore.Analyzers.InteropServices
{
public sealed partial class CSharpDisableRuntimeMarshallingFixer
{
- private class CustomFixAllProvider : DocumentBasedFixAllProvider
+ private class CustomFixAllProvider : Analyzer.Utilities.DocumentBasedFixAllProvider
{
public static readonly CustomFixAllProvider Instance = new();
diff --git a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/DoNotDirectlyAwaitATask.Fixer.cs b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/DoNotDirectlyAwaitATask.Fixer.cs
index 738fdebf2..6d13947ce 100644
index 331c0a4fe..492d0d4c1 100644
--- a/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/DoNotDirectlyAwaitATask.Fixer.cs
+++ b/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/DoNotDirectlyAwaitATask.Fixer.cs
@@ -82,7 +82,7 @@ private class MyCodeAction : DocumentChangeAction
@@ -74,7 +74,7 @@ public sealed override FixAllProvider GetFixAllProvider()
return CustomFixAllProvider.Instance;
}