-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use analyzers from targeting pack for .NET Current
Add analyzers to the frameworklist that OOB projects in src/libraries use, and only auto ProjectReference the analyzers in generators.targets when not using the analyzers from the targeting pack.
- Loading branch information
1 parent
b90a734
commit c6d7dcb
Showing
7 changed files
with
78 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<GeneratorProjectBaseTargetPath>analyzers/dotnet</GeneratorProjectBaseTargetPath> | ||
<GeneratorProjectBaseTargetPath Condition="'$(AnalyzerLanguage)' != ''">$(GeneratorProjectBaseTargetPath)/$(AnalyzerLanguage)</GeneratorProjectBaseTargetPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<BinPlaceDir Include="$(MicrosoftNetCoreAppRefPackDir)$(GeneratorProjectBaseTargetPath)" | ||
Condition="'$(IsNETCoreAppAnalyzer)' == 'true'" /> | ||
</ItemGroup> | ||
|
||
<ItemDefinitionGroup> | ||
<TargetPathWithTargetPlatformMoniker> | ||
<GeneratorProjectBaseTargetPath>$(GeneratorProjectBaseTargetPath)</GeneratorProjectBaseTargetPath> | ||
</TargetPathWithTargetPlatformMoniker> | ||
</ItemDefinitionGroup> | ||
|
||
<Target Name="GetAnalyzerPackFiles" | ||
DependsOnTargets="$(GenerateNuspecDependsOn)" | ||
Returns="@(_AnalyzerPackFile)"> | ||
<PropertyGroup> | ||
<_analyzerPath>analyzers/dotnet</_analyzerPath> | ||
<_analyzerPath Condition="'$(_analyzerPath)' != ''">$(_analyzerPath)/roslyn$(AnalyzerRoslynVersion)</_analyzerPath> | ||
<_analyzerPath Condition="'$(_analyzerPath)' != ''">$(_analyzerPath)/$(AnalyzerLanguage)</_analyzerPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<_AnalyzerPackFile Include="@(_BuildOutputInPackage)" IsSymbol="false" /> | ||
<_AnalyzerPackFile Include="@(_TargetPathsToSymbols)" IsSymbol="true" /> | ||
<_AnalyzerPackFile PackagePath="$(_analyzerPath)/%(TargetPath)" /> | ||
</ItemGroup> | ||
|
||
<Error Condition="'%(_AnalyzerPackFile.TargetFramework)' != 'netstandard2.0'" | ||
Text="Analyzers must only target netstandard2.0 since they run in the compiler which targets netstandard2.0. The following files were found to target '%(_AnalyzerPackFile.TargetFramework)': @(_AnalyzerPackFile)" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
...InteropServices/gen/LibraryImportGenerator/Microsoft.Interop.LibraryImportGenerator.props
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters