From d3af4921f36dba8dde35ade7dff59a3a192edddb Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 12 May 2022 09:22:26 +0200 Subject: Define convention to consume and/or package analyzers (#69069) * Define convention to include analyzers in ref pack Fixes https://github.com/dotnet/runtime/issues/61321 Until now we required source libraries to define ProjectReferences when an analyzer should be part of the shared framework. That strategy causes analyzer projects to leak into the ProjectReference closure and by that into a solution file. As an example: When another library references the source library that references the analyzer, the analyzer is part of the dependency closure even though it might not be required. This change makes it possible to define the shared framework analyzer projects in the NetCoreAppLibrary.props file for both the .NETCoreApp, and the AspNetCoreApp shared framework. Out-of-band projects which ship analyzers inside their produced package, continue to reference the analyzers via the `AnalyzerProject` item. * Use AnalyzerReference consistently * Don't reference analyzer when its packaged * Fix P2P reference * Fix multi target roslyn component target condition --- eng/generators.targets | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'eng/generators.targets') diff --git a/eng/generators.targets b/eng/generators.targets index 69c3c12cbb4..c123ad66387 100644 --- a/eng/generators.targets +++ b/eng/generators.targets @@ -41,17 +41,18 @@ That is required as the EnabledGenerators condition checks on the Reference and ProjectReference items and hence can't be a property condition. --> - + - - - + + + Pack="false" /> +