From ffa4923a6e5332410f44444c890d685d8cbaf434 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 1 Jul 2021 05:49:52 -0700 Subject: [PATCH] Add analyzers to ref-pack / ASP.NET transport package (#54950) * Add analyzers to ref-pack / ASP.NET transport package * Updating shared framework SDK * Respond to feedback * Update arcade SDKs and remove property --- docs/coding-guidelines/libraries-packaging.md | 4 ++++ eng/Version.Details.xml | 8 ++++---- global.json | 4 ++-- .../sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj | 2 ++ src/libraries/Directory.Build.props | 5 +++-- src/libraries/Directory.Build.targets | 5 +++++ .../gen/Microsoft.Extensions.Logging.Generators.csproj | 1 + .../System.Text.Json/gen/System.Text.Json.SourceGeneration.csproj | 2 ++ 8 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/coding-guidelines/libraries-packaging.md b/docs/coding-guidelines/libraries-packaging.md index 51c5424..95b1183 100644 --- a/docs/coding-guidelines/libraries-packaging.md +++ b/docs/coding-guidelines/libraries-packaging.md @@ -14,6 +14,8 @@ In some occasions we may want to include a library in the shared framework, but Libraries included in the shared framework should ensure all direct and transitive assembly references are also included in the shared framework. This will be validated as part of the build and errors raised if any dependencies are unsatisfied. +Source generators and analyzers can be included in the shared framework by specifying `IsNetCoreAppAnalyzer`. These projects should specify `AnalyzerLanguage` as mentioned [below](#analyzers--source-generators). + Removing a library from the shared framework is a breaking change and should be avoided. ## Transport package @@ -26,6 +28,8 @@ This package represents the set of libraries which are produced in dotnet/runtim To add a library to the ASP.NETCore shared framework, that library should set the `IsAspNetCoreApp` property for its `ref` and `src` project. This is typically done in the library's `Directory.Build.props`, for example https://github.com/dotnet/runtime/blob/98ac23212e6017c615e7e855e676fc43c8e44cb8/src/libraries/Microsoft.Extensions.Logging.Abstractions/Directory.Build.props#L4. +Source generators and analyzers can be included in the ASP.NETCore shared framework by specifying `IsAspNetCoreAppAnalyzer`. These projects should specify `AnalyzerLanguage` as mentioned [below](#analyzers--source-generators). + Libraries included in this transport package should ensure all direct and transitive assembly references are also included in either the ASP.NETCore shared framework or the .NETCore shared framework. This is not validated in dotnet/runtime at the moment: https://github.com/dotnet/runtime/issues/52562 Removing a library from this transport package is a breaking change and should be avoided. diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cfe0a88..1a64248 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,9 +54,9 @@ https://github.com/dotnet/arcade 6b9d24236d8d1906284e6cb6c28e3fe93a69b7d2 - + https://github.com/dotnet/arcade - 6b9d24236d8d1906284e6cb6c28e3fe93a69b7d2 + ff3e7d23139c30feefe36d3d4e8d41a06160f254 https://github.com/dotnet/arcade @@ -70,9 +70,9 @@ https://github.com/dotnet/arcade 6b9d24236d8d1906284e6cb6c28e3fe93a69b7d2 - + https://github.com/dotnet/arcade - 6b9d24236d8d1906284e6cb6c28e3fe93a69b7d2 + ff3e7d23139c30feefe36d3d4e8d41a06160f254 https://github.com/microsoft/vstest diff --git a/global.json b/global.json index 77fd48d..f2f7fc3 100644 --- a/global.json +++ b/global.json @@ -12,11 +12,11 @@ "python3": "3.7.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.21329.8", + "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.21330.3", "Microsoft.DotNet.PackageValidation": "1.0.0-preview.6.21274.7", "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21329.8", "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.21329.8", - "Microsoft.DotNet.SharedFramework.Sdk": "6.0.0-beta.21329.8", + "Microsoft.DotNet.SharedFramework.Sdk": "6.0.0-beta.21330.3", "Microsoft.Build.NoTargets": "3.0.4", "Microsoft.Build.Traversal": "3.0.23", "Microsoft.NET.Sdk.IL": "6.0.0-preview.7.21321.2" diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj index bbdfeca..f1e52a7 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Ref.sfxproj @@ -15,6 +15,8 @@ + + diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 3981181..4d39fad 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -128,8 +128,9 @@ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(TestArchiveRoot)runtime/ - $(ArtifactsBinDir)pkg\aspnetcoreapp\ref - $(ArtifactsBinDir)pkg\aspnetcoreapp\lib + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'pkg', 'aspnetcoreapp')) + $([MSBuild]::NormalizeDirectory('$(ASPNETCoreAppPackageRootPath)', 'ref')) + $([MSBuild]::NormalizeDirectory('$(ASPNETCoreAppPackageRootPath)', 'lib')) $([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'Common')) $([MSBuild]::NormalizeDirectory('$(CommonPathRoot)', 'src')) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 2748785..b107052 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -42,6 +42,7 @@ true + + true false false + true cs diff --git a/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.csproj b/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.csproj index ec46f79..176138c 100644 --- a/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.csproj +++ b/src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.csproj @@ -7,6 +7,8 @@ CS1574 false true + true + cs -- 2.7.4