-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the build compatible with .NET 9 SDK (#2840)
* Move all warning-as-error handling to build props * Disable warning-as-error in Debug builds * Lower AnalysisLevel to .NET 8 wave when treating warnings as errors in Release * Pass --self-contained explicitly to dotnet publish with runtime identifier for forward compat
- Loading branch information
Showing
5 changed files
with
37 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<Project> | ||
<Import Project="build.warnings_as_errors.props" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project> | ||
<!-- | ||
NOTE: We only turn on warnings-as-errors in Release because it hurts | ||
iteration time in the IDE to error out while the code is still | ||
work-in-progress. | ||
--> | ||
<PropertyGroup Label="WarningsAsErrors" Condition="'$(Configuration)' == 'Release'"> | ||
<!-- Treat compiler warnings as errors. --> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
|
||
<!-- Treat all build warnings as errors --> | ||
<MSBuildTreatWarningsAsErrors>$(TreatWarningsAsErrors)</MSBuildTreatWarningsAsErrors> | ||
|
||
<!-- | ||
NU190X are security vulnerability warnings and can trigger without code | ||
changes. Don't let them break the build. | ||
--> | ||
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors> | ||
<MSBuildWarningsNotAsErrors>$(WarningsNotAsErrors)</MSBuildWarningsNotAsErrors> | ||
|
||
<!-- | ||
We are not yet clean on new analysis introduced with .NET 9 SDK so lower | ||
the analysis level when treating warnings as errors in Release. | ||
--> | ||
<AnalysisLevel>8</AnalysisLevel> | ||
</PropertyGroup> | ||
</Project> |