-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectory.Build.props
56 lines (47 loc) · 2.49 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
<!-- This is automatically imported into every .csproj -->
<Project>
<PropertyGroup>
<ParentPath>$([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))</ParentPath>
<IsSrcFolder>$(ParentPath.EndsWith('src', StringComparison.OrdinalIgnoreCase))</IsSrcFolder>
<!-- Handle both flat and structured test folders: tests\MyProject.UnitTests and tests\unit\MyProject.UnitTests -->
<IsTestsFolder>$(ParentPath.EndsWith('tests', StringComparison.OrdinalIgnoreCase))</IsTestsFolder>
</PropertyGroup>
<PropertyGroup>
<Authors>Chris Nussbaum</Authors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RunSettingsFilePath>$(MSBuildThisFileDirectory)\.runsettings</RunSettingsFilePath>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
</PropertyGroup>
<!-- StyleCop -->
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Link="stylecop.json" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition="'$(IsSrcFolder)' == 'true'">
<RuntimeIdentifier Condition="'$(DOTNET_RUNNING_IN_CONTAINER)' == 'true'">linux-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup Condition="'$(IsSrcFolder)' == 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.61">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition="'$(IsTestsFolder)' == 'true'">
<IsPackable>false</IsPackable>
<RuntimeIdentifier Condition="'$(DOTNET_RUNNING_IN_CONTAINER)' == 'true'">linux-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestsFolder)' == 'true'">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>