-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
Directory.Build.props
62 lines (54 loc) · 2.75 KB
/
Directory.Build.props
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
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisMode>Recommended</AnalysisMode>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
<RunSettingsFilePath>$(MSBuildThisFileDirectory)tests.runsettings</RunSettingsFilePath>
<JsonApiDotNetCoreVersionPrefix>5.6.1</JsonApiDotNetCoreVersionPrefix>
<NuGetAuditMode>direct</NuGetAuditMode>
<NoWarn>$(NoWarn);NETSDK1215</NoWarn>
</PropertyGroup>
<PropertyGroup>
<!--
Disabled IDE analyzers for "Use collection expression" because they are dangerous in a subtle way.
For example, a suggestion for the following code is raised:
public IList<string> Items { get; } = new List<string>();
Taking the suggestion TODAY produces List<string>, but the spec doesn't require that, so the compiler may change it over time.
As a result, callers that cast back to List<string> will face a breaking change.
-->
<UseCollectionExpressionRules>IDE0028;IDE0300;IDE0301;IDE0302;IDE0303;IDE0304;IDE0305</UseCollectionExpressionRules>
<NoWarn>$(NoWarn);$(UseCollectionExpressionRules)</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<NoWarn>$(NoWarn);AV2210</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<NoWarn>$(NoWarn);1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(CI)' != ''">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('Tests'))">
<NoWarn>$(NoWarn);CA1707;CA1062</NoWarn>
</PropertyGroup>
<PropertyGroup
Condition="$(MSBuildProjectName.EndsWith('Example')) Or '$(MSBuildProjectName)' == 'TestBuildingBlocks' Or '$(MSBuildProjectName)' == 'Benchmarks'">
<NoWarn>$(NoWarn);CA1062</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<!-- Workaround for https://github.com/dotnet/runtime/issues/72263 -->
<NoWarn>$(NoWarn);SYSLIB1006</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2024.2.*" PrivateAssets="All" />
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.8.*" PrivateAssets="All" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
</ItemGroup>
</Project>