1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 09:34:49 +09:00

Don't enable ILLink analyzers for unsupported TFMs (#87071)

* Don't enable ILLink analyzers for unsupported TFMs

This adds a condition to EnableSingleFileAnalyzer to prevent it from requiring
the ILLink pack that is only supported on netcoreapp3.0 and above.

Adding a condition on the TFM requires moving the setting into a targets file.

Also consolidates more of the analyzer logic into this file.

---------

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
This commit is contained in:
Sven Boemer 2023-06-08 10:10:58 -07:00 committed by GitHub
parent 1d5ee1c9e2
commit 56c427bb4d
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 11 deletions

View file

@ -4,7 +4,7 @@ This repo relies on [.NET Compiler Platform analyzers](https://learn.microsoft.c
To add an analyzer package to the build:
1. Select a package you want to employ, for example https://www.nuget.org/packages/SonarAnalyzer.CSharp/. This analyzer package's name is `SonarAnalyzer.CSharp` and the latest version as of this edit is `8.50.0.58025`.
2. Add a `PackageReference` entry to <https://github.com/dotnet/runtime/blob/main/eng/Analyzers.props>, e.g.
2. Add a `PackageReference` entry to <https://github.com/dotnet/runtime/blob/main/eng/Analyzers.targets>, e.g.
```XML
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.50.0.58025" PrivateAssets="all" />
```