-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the build compatible with .NET 9 SDK #2840
Conversation
nguerrera
commented
Nov 18, 2024
•
edited
Loading
edited
- 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
@@ -2,7 +2,10 @@ | |||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
|
|||
<PropertyGroup> | |||
<LangVersion>8.0</LangVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this was already reset to latest below this before.
@@ -38,7 +38,7 @@ $npmBuildFolder = "$BuildRoot\Publish\npm" | |||
if (-not $SkipBuild) { | |||
Write-Information "Building Sarif.Multitool for Windows, Linux, and MacOS..." | |||
foreach ($runtime in "win-x64", "linux-x64", "osx-x64") { | |||
dotnet publish $SourceRoot\$project\$project.csproj -c $Configuration -f netcoreapp3.1 -r $runtime | |||
dotnet publish $SourceRoot\$project\$project.csproj -c $Configuration -f netcoreapp3.1 -r $runtime --self-contained |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a .NET 9 SDK warning that tells us that --self-contained will no longer be the default as before when runtime identifier is specified.
* 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
1eaaed1
to
973dc49
Compare
@@ -0,0 +1,3 @@ | |||
<Project> | |||
<Import Project="build.warnings_as_errors.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is maddeningly difficult to get the same behavior for building .sln as .csproj for these settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.