Skip to content

Commit

Permalink
Set some useful MSBuild properties for all projects (#866)
Browse files Browse the repository at this point in the history
* chore: set TreatWarningsAsErrors

* chore: set OptimizeImplicitlyTriggeredBuild

* chore: set EnforceCodeStyleInBuild
  • Loading branch information
tnotheis authored Sep 16, 2024
1 parent 2fbd346 commit 63bb145
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
9 changes: 3 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
<AssemblyName>Backbone.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName.Replace(" ", "_"))</RootNamespace>
<Nullable>enable</Nullable>
<WarningsAsErrors>
CS8597,CS8600,CS8601,CS8602,CS8603,CS8604,CS8605,CS8607,CS8608,CS8609,CS8610,CS8611,CS8612,CS8613,CS8614,CS8615,
CS8616,CS8617,CS8618,CS8619,CS8620,CS8621,CS8622,CS8624,CS8625,CS8629,CS8631,CS8633,CS8634,CS8643,CS8644,CS8645,
CS8655,CS8667,CS8670,CS8714,CS8762,CS8763,CS8764,CS8765,CS8766,CS8767,CS8768,CS8769,CS8770,CS8774,CS8776,CS8775,
CS8777,CS8819,CS8824,CS8825,CS8847
</WarningsAsErrors>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<OptimizeImplicitlyTriggeredBuild>True</OptimizeImplicitlyTriggeredBuild>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
</Project>
15 changes: 6 additions & 9 deletions Modules/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,26 @@
<AssemblyName>Backbone.Modules.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName.Replace(" ", "_"))</RootNamespace>
<Nullable>enable</Nullable>
<WarningsAsErrors>
CS8597,CS8600,CS8601,CS8602,CS8603,CS8604,CS8605,CS8607,CS8608,CS8609,CS8610,CS8611,CS8612,CS8613,CS8614,CS8615,
CS8616,CS8617,CS8618,CS8619,CS8620,CS8621,CS8622,CS8624,CS8625,CS8629,CS8631,CS8633,CS8634,CS8643,CS8644,CS8645,
CS8655,CS8667,CS8670,CS8714,CS8762,CS8763,CS8764,CS8765,CS8766,CS8767,CS8768,CS8769,CS8770,CS8774,CS8776,CS8775,
CS8777,CS8819,CS8824,CS8825,CS8847
</WarningsAsErrors>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<OptimizeImplicitlyTriggeredBuild>True</OptimizeImplicitlyTriggeredBuild>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<!-- 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) -->
<ItemGroup Condition="'$(Configuration)' != 'Release' And $(MSBuildProjectFile.Contains('Relationships'))">
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\UnitTestTools\UnitTestTools.csproj" />
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\UnitTestTools\UnitTestTools.csproj"/>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'Release' And $(MSBuildProjectFile.Contains('Relationships'))">
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>

0 comments on commit 63bb145

Please sign in to comment.