mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-10 18:11:04 +09:00

Summary: Enables single file analyzer in the runtime by adding the ILLink.Analyzers package and the property EnableSingleFileAnalyzer equals to true Deletes entries IL3000 and IL3001 in the CodeAnalysis.ruleset so the analyzer can actually produce these warnings otherwise the analyzer execution would be skipped. *Note*: tests warnings are controlled by CodeAnalysis.test.ruleset (this PR adds IL3002 to the CodeAnalysis.test.ruleset to disable the warning on tests) Resolve warnings on single file dangerous patterns by: - Annotating incompatible single file patterns with RequiresAssemblyFiles - Suppressing the warning (because there is code that handles the incompatible code) - Fixing the issue on code (remove the incompatible code and replace it with something that won't fail) - Opening an issue to track fix and either annotate/suppress the current behavior
51 lines
2.6 KiB
XML
51 lines
2.6 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
<PropertyGroup>
|
|
<TargetFrameworks>$(NetCoreAppToolCurrent);$(TargetFrameworkForNETFramework)</TargetFrameworks>
|
|
<Nullable>enable</Nullable>
|
|
<NoWarn>$(NoWarn),CA1050</NoWarn>
|
|
<!-- Ignore nullable warnings on net4* -->
|
|
<NoWarn Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">$(NoWarn),CS8604,CS8602</NoWarn>
|
|
<EnableSingleFileAnalyzer>false</EnableSingleFileAnalyzer>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
|
|
<Compile Include="..\Common\IsExternalInit.cs" />
|
|
<Compile Include="$(RepoRoot)src\libraries\System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="Microsoft.Build" Version="$(RefOnlyMicrosoftBuildVersion)" />
|
|
<PackageReference Include="Microsoft.Build.Framework" Version="$(RefOnlyMicrosoftBuildFrameworkVersion)" />
|
|
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(RefOnlyMicrosoftBuildTasksCoreVersion)" />
|
|
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(RefOnlyMicrosoftBuildUtilitiesCoreVersion)" />
|
|
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="4.7.1" />
|
|
</ItemGroup>
|
|
|
|
<Target Name="PublishBuilder"
|
|
AfterTargets="Build">
|
|
|
|
<!-- needed for publishing with multi-targeting. We are publishing essentially to get the SR.MetadataLoadContext.dll :/ -->
|
|
<ItemGroup>
|
|
<_PublishFramework Include="$(TargetFrameworks)" />
|
|
</ItemGroup>
|
|
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Publish" Properties="TargetFramework=%(_PublishFramework.Identity)" />
|
|
</Target>
|
|
|
|
<Target Name="GetFilesToPackage" Returns="@(FilesToPackage)">
|
|
<ItemGroup>
|
|
<_PublishFramework Remove="@(_PublishFramework)" />
|
|
<_PublishFramework Include="$(TargetFrameworks)" />
|
|
|
|
<!-- non-net4* -->
|
|
<FilesToPackage Include="$(OutputPath)$(NetCoreAppToolCurrent)\$(MSBuildProjectName)*"
|
|
TargetPath="tasks\$(NetCoreAppToolCurrent)" />
|
|
<FilesToPackage Include="$(OutputPath)$(NetCoreAppToolCurrent)\publish\System.Reflection.MetadataLoadContext.dll"
|
|
TargetPath="tasks\$(NetCoreAppToolCurrent)" />
|
|
|
|
<!-- for net472 we need all the dependent assemblies too, so copy from the publish folder -->
|
|
<FilesToPackage Include="$(OutputPath)$(TargetFrameworkForNETFramework)\publish\*"
|
|
TargetPath="tasks\$(TargetFrameworkForNETFramework)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|