zs
2025-05-16 0e4ee9eeb9552babb6541d7be3b60400ce69df79
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<Project>
    <!-- C# compiler options (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/) -->
    <PropertyGroup>
        <!-- Nullable (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/language#nullable) -->
        <Nullable>disable</Nullable>
        <Deterministic>true</Deterministic>
        <!-- report errors and warnings (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings) -->
        <WarningLevel>5</WarningLevel>
    </PropertyGroup>
 
    <!-- Generated file properties (https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#generated-file-properties) -->
    <PropertyGroup>
        <ImplicitUsings>enable</ImplicitUsings>
    </PropertyGroup>
 
    <!-- Code analysis properties (https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#code-analysis-properties) -->
    <PropertyGroup>
        <EnableNETAnalyzers>true</EnableNETAnalyzers>
        <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
        <AnalysisMode>All</AnalysisMode>
        <AnalysisLevel>latest</AnalysisLevel>
    </PropertyGroup>
 
    <ItemGroup>
        <AdditionalFiles Include="$([MSBuild]::GetPathOfFileAbove('stylecop.json'))" Visible="false" />
    </ItemGroup>
 
    <!-- Dependencies -->
    <ItemGroup Condition="$(MSBuildProjectExtension) == '.csproj'" >
        <PackageReference Include="SonarAnalyzer.CSharp" Version="8.32.0.39516" PrivateAssets="all" />
        <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
        <PackageReference Include="Roslynator.Analyzers" Version="3.3.0" PrivateAssets="all" />
    </ItemGroup>
 
    <PropertyGroup Condition=" '$(Configuration)' == 'Debug'">
        <DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
        <Optimize>false</Optimize>
        <NullableReferenceTypes>true</NullableReferenceTypes>
        <!-- report errors and warnings (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings) -->
        <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
        <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
    </PropertyGroup>
 
    <PropertyGroup Condition="'$(Configuration)' == 'Release'">
        <DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
        <Optimize>true</Optimize>
        <!-- report errors and warnings (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings) -->
        <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
        <CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
    </PropertyGroup>
 
    <!-- Import reference package -->
    <Import Project="package.reference.props" />
 
    <!-- Test Project coverlet collector -->
    <PropertyGroup>
        <IsTestProject Condition="$(MSBuildProjectFullPath.Contains('test')) and ($(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.TestBase')))">true</IsTestProject>
    </PropertyGroup>
 
    <ItemGroup>
        <PackageReference Condition="'$(IsTestProject)' == 'true'" Include="coverlet.collector" Version="3.1.0">
            <PrivateAssets>all</PrivateAssets>
            <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
        </PackageReference>
    </ItemGroup>
</Project>