coding-conventions/.NET/directory.build.props

69 lines
3.3 KiB
Text
Raw Permalink Normal View History

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- General compiler configuration. -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
</PropertyGroup>
<PropertyGroup>
<!--
Workaround for changing severity of rules with Location.None - e.g. CA1014
- see https://github.com/dotnet/roslyn/issues/37876#issuecomment-738042719
Needed until those types of rules can be disabled in a Global Analyzer Config
- when https://github.com/dotnet/roslyn/issues/48634 is implemented.
# CA1014: Mark assemblies with CLSCompliantAttribute
-->
<NoWarn>$(NoWarn);CA1014</NoWarn>
</PropertyGroup>
<ItemGroup>
<!--
These two options are necessary for IDE0130 to work:
- see https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0130
# IDE0130: Namespace does not match folder structure
-->
<CompilerVisibleProperty Include="RootNamespace" />
<CompilerVisibleProperty Include="ProjectDir" />
</ItemGroup>
<!-- Include StyleCop Configuration from repository root. -->
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
</ItemGroup>
<!-- Include static code analyzers. -->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.8.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.6.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="4.6.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.6.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>