Skip to content

Commit 63bb145

Browse files
authored
Set some useful MSBuild properties for all projects (#866)
* chore: set TreatWarningsAsErrors * chore: set OptimizeImplicitlyTriggeredBuild * chore: set EnforceCodeStyleInBuild
1 parent 2fbd346 commit 63bb145

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

Directory.Build.props

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
<AssemblyName>Backbone.$(MSBuildProjectName)</AssemblyName>
66
<RootNamespace>$(AssemblyName.Replace(" ", "_"))</RootNamespace>
77
<Nullable>enable</Nullable>
8-
<WarningsAsErrors>
9-
CS8597,CS8600,CS8601,CS8602,CS8603,CS8604,CS8605,CS8607,CS8608,CS8609,CS8610,CS8611,CS8612,CS8613,CS8614,CS8615,
10-
CS8616,CS8617,CS8618,CS8619,CS8620,CS8621,CS8622,CS8624,CS8625,CS8629,CS8631,CS8633,CS8634,CS8643,CS8644,CS8645,
11-
CS8655,CS8667,CS8670,CS8714,CS8762,CS8763,CS8764,CS8765,CS8766,CS8767,CS8768,CS8769,CS8770,CS8774,CS8776,CS8775,
12-
CS8777,CS8819,CS8824,CS8825,CS8847
13-
</WarningsAsErrors>
8+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
9+
<OptimizeImplicitlyTriggeredBuild>True</OptimizeImplicitlyTriggeredBuild>
10+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1411
</PropertyGroup>
1512
</Project>

Modules/Directory.Build.props

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,26 @@
55
<AssemblyName>Backbone.Modules.$(MSBuildProjectName)</AssemblyName>
66
<RootNamespace>$(AssemblyName.Replace(" ", "_"))</RootNamespace>
77
<Nullable>enable</Nullable>
8-
<WarningsAsErrors>
9-
CS8597,CS8600,CS8601,CS8602,CS8603,CS8604,CS8605,CS8607,CS8608,CS8609,CS8610,CS8611,CS8612,CS8613,CS8614,CS8615,
10-
CS8616,CS8617,CS8618,CS8619,CS8620,CS8621,CS8622,CS8624,CS8625,CS8629,CS8631,CS8633,CS8634,CS8643,CS8644,CS8645,
11-
CS8655,CS8667,CS8670,CS8714,CS8762,CS8763,CS8764,CS8765,CS8766,CS8767,CS8768,CS8769,CS8770,CS8774,CS8776,CS8775,
12-
CS8777,CS8819,CS8824,CS8825,CS8847
13-
</WarningsAsErrors>
8+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
9+
<OptimizeImplicitlyTriggeredBuild>True</OptimizeImplicitlyTriggeredBuild>
10+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1411
</PropertyGroup>
1512

1613
<!-- Relationships Module is currently the only one with its respective unit tests next to the production (within the same project, as opposed to on a separate one) -->
1714
<ItemGroup Condition="'$(Configuration)' != 'Release' And $(MSBuildProjectFile.Contains('Relationships'))">
18-
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\UnitTestTools\UnitTestTools.csproj" />
15+
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\UnitTestTools\UnitTestTools.csproj"/>
1916
</ItemGroup>
2017

2118
<ItemGroup Condition="'$(Configuration)' != 'Release' And $(MSBuildProjectFile.Contains('Relationships'))">
2219
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
2320
<PrivateAssets>all</PrivateAssets>
2421
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2522
</PackageReference>
26-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
23+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
2724
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1">
2825
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2926
<PrivateAssets>all</PrivateAssets>
3027
</PackageReference>
3128
</ItemGroup>
32-
29+
3330
</Project>

0 commit comments

Comments
 (0)