-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Directory.Build.props
50 lines (43 loc) · 2.65 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
<Project>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!--
Enable the latest warning wave, which shows additional warnings for invalid language features that are disabled by default.
For additional info, see https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/warning-waves.
-->
<AnalysisLevel>latest</AnalysisLevel>
<!-- Import the global configs from the CodeStyle package (enables all IDExxxx warnings)-->
<AnalysisLevelStyle>latest-all</AnalysisLevelStyle>
<!-- Enforce all code style rules during build (this replaces referencing Microsoft.CodeAnalysis.CSharp.CodeStyle) -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<!--
Enable the compiler strict mode (see https://www.meziantou.net/csharp-compiler-strict-mode.htm).
This (poorly documented) mode enables additional warnings for incorrect usages of some features.
For instance, this will warn when using the == operator to compare a struct with a null literal.
-->
<Features>strict</Features>
<!--
Opt-in feature that allows skipping unnecessary MSBuild invocations during incremental builds.
See https://devblogs.microsoft.com/visualstudio/vs-toolbox-accelerate-your-builds-of-sdk-style-net-projects/.
-->
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<!--
Suppress ref safety warnings in unsafe contexts (see https://github.com/dotnet/csharplang/issues/6476).
This is used eg. to replace Unsafe.SizeOf<T>() calls with just sizeof(T). The warning is not necessary
since in order to use these APIs the caller already has to be in an unsafe context.
-->
<NoWarn>$(NoWarn);CS8500</NoWarn>
<!--
Generate documentation files. In theory this should only be abled for published, non source generator projects.
However, this is always enabled to work around https://github.com/dotnet/roslyn/issues/41640. Until that's fixed,
source generators will also produce an .xml file with their documentation. Note that this doesn't really impact
NuGet packages, since the analyzer binaries are packed manually after build, so the .xml files aren't included.
When this workaround is no longer needed, the same property should also removed for the \samples directory.
Once that issue is fixed, this should be moved down to the src\ specific .props file again, and otherwise disabled.
-->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
</Project>