-
Notifications
You must be signed in to change notification settings - Fork 39
/
Directory.Build.props
42 lines (38 loc) · 1.81 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
<Project>
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>1591</WarningsNotAsErrors>
<!-- Move to WarningsNotAsErrors after https://github.com/NuGet/Home/issues/5375 -->
<NoWarn>NU5104</NoWarn>
<Nullable>enable</Nullable>
<DefaultItemExcludes>$(DefaultItemExcludes);node_modules\**</DefaultItemExcludes>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
<PropertyGroup>
<HasPublicApi Condition="
!$(MSBuildProjectName.Contains('Demo'))
And
!$(MSBuildProjectName.Contains('Tests'))
And
'$(MSBuildProjectName)' != 'Benchmarks'
And
'$(MSBuildProjectName)' != 'WebAssets'
">true</HasPublicApi>
</PropertyGroup>
<ItemGroup>
<PackageReference Condition="'$(HasPublicApi)' == 'true' And '$(MSBuildProjectName)' != 'Common'" Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Common currently crashes, see https://github.com/dotnet/roslyn-analyzers/issues/3445 -->
<PackageReference Condition="'$(HasPublicApi)' == 'true' And '$(MSBuildProjectName)' == 'Common'" Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(HasPublicApi)' == 'true'">
<AdditionalFiles Include="PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
</ItemGroup>
</Project>