From 0db94b6e80b243141f2b3c5103ae6fa01a023f89 Mon Sep 17 00:00:00 2001 From: Justin Emgarten Date: Sat, 30 Nov 2024 17:11:25 -0800 Subject: [PATCH] add net9.0 support (#26) --- ReleaseNotes.md | 4 ++ build.ps1 | 5 +-- build/build.proj | 2 +- build/common/common.ps1 | 45 +------------------ build/common/common.sh | 13 +----- build/common/common.targets | 6 +-- build/config.props | 6 +-- src/NupkgWrench/NupkgWrench.csproj | 2 +- .../NupkgWrench.Tests.csproj | 2 +- test/Test.Common/Test.Common.csproj | 6 +++ 10 files changed, 23 insertions(+), 68 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index da94459..4228ac5 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,9 @@ # Release Notes +## 4.3.0 +* Add net9.0 support +* Update NuGet.* packages to 6.12.1 + ## 4.2.0 * Add net8.0 support, remove net7.0 support * Update NuGet.* packages to 6.9.1 diff --git a/build.ps1 b/build.ps1 index ab0bd1a..9d080be 100644 --- a/build.ps1 +++ b/build.ps1 @@ -15,9 +15,6 @@ pushd $RepoRoot # Download tools Install-CommonBuildTools $RepoRoot -# Run dotnet-format to apply style fixes or fail on CI builds -Invoke-DotnetFormat $RepoRoot - # Clean and write git info Remove-Artifacts $RepoRoot Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:Clean;WriteGitInfo", "/p:Configuration=$Configuration") @@ -43,6 +40,6 @@ if (-not $SkipPack) # Run build.proj Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:$buildTargets", "/p:Configuration=$Configuration") - + popd Write-Host "Success!" diff --git a/build/build.proj b/build/build.proj index 742c2d5..320da5c 100644 --- a/build/build.proj +++ b/build/build.proj @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/build/common/common.ps1 b/build/common/common.ps1 index 279e16a..5cbb645 100644 --- a/build/common/common.ps1 +++ b/build/common/common.ps1 @@ -24,6 +24,7 @@ Function Install-DotnetCLI { & $installDotnet -Channel 6.0 -i $CLIRoot & $installDotnet -Channel 8.0 -i $CLIRoot + & $installDotnet -Channel 9.0 -i $CLIRoot if (-not (Test-Path $DotnetExe)) { Write-Log "Missing $DotnetExe" @@ -72,7 +73,7 @@ Function Install-NuGetExe { $nugetDir = Split-Path $nugetExe New-Item -ItemType Directory -Force -Path $nugetDir - Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/v6.9.1/nuget.exe -OutFile $nugetExe + Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/v6.12.1/nuget.exe -OutFile $nugetExe } } @@ -126,21 +127,6 @@ Function Invoke-DotnetMSBuild { Invoke-DotnetExe $RepoRoot $buildArgs } -Function Install-DotnetTools { - param( - [string]$RepoRoot - ) - - $toolsPath = Join-Path $RepoRoot ".nuget/tools" - - if (-not (Test-Path $toolsPath)) { - Write-Host "Installing dotnet tools to $toolsPath" - $args = @("tool","install","--tool-path",$toolsPath,"--ignore-failed-sources","dotnet-format","--version","5.1.250801") - - Invoke-DotnetExe $RepoRoot $args - } -} - Function Install-CommonBuildTools { param( [string]$RepoRoot @@ -148,31 +134,4 @@ Function Install-CommonBuildTools { Install-DotnetCLI $RepoRoot Install-NuGetExe $RepoRoot - Install-DotnetTools $RepoRoot -} - -Function Invoke-DotnetFormat { - param( - [string]$RepoRoot - ) - - # Only run in local dev envs - if ($env:CI -ne "True") - { - $formatExe = Join-Path $RepoRoot ".nuget/tools/dotnet-format.exe" - - $args = @("--fix-whitespace", "--fix-style", "warn") - - $command = "$formatExe $args" - Write-Host "[EXEC] $command" -ForegroundColor Cyan - - & $formatExe $args - - if (-not $?) { - Write-Warning "dotnet-format failed. Please fix the style errors!" - - # Currently dotnet-format fails on CIs but not locally in some scenarios - # exit 1 - } - } } \ No newline at end of file diff --git a/build/common/common.sh b/build/common/common.sh index 4623e11..3345036 100644 --- a/build/common/common.sh +++ b/build/common/common.sh @@ -7,8 +7,6 @@ run_standard_tests() # Download dotnet cli REPO_ROOT=$(pwd) DOTNET=$(pwd)/.cli/dotnet - DOTNET_TOOLS=$(pwd)/.nuget/tools - DOTNET_FORMAT=$DOTNET_TOOLS/dotnet-format if [ ! -f $DOTNET ]; then echo "Installing dotnet" @@ -19,21 +17,12 @@ run_standard_tests() chmod +x .cli/dotnet-install.sh .cli/dotnet-install.sh -i .cli --channel 6.0 .cli/dotnet-install.sh -i .cli --channel 8.0 + .cli/dotnet-install.sh -i .cli --channel 9.0 fi # Display info $DOTNET --info - # install dotnet-format - if [ ! -d $DOTNET_TOOLS ]; then - echo "Installing dotnet tools" - mkdir -p .nuget/tools - - $DOTNET tool install --tool-path $DOTNET_TOOLS --ignore-failed-sources dotnet-format --version 5.1.250801 - fi - - $DOTNET_FORMAT --fix-whitespace --fix-style warn - # clean rm -r -f $(pwd)/artifacts diff --git a/build/common/common.targets b/build/common/common.targets index eb81446..146a563 100644 --- a/build/common/common.targets +++ b/build/common/common.targets @@ -23,7 +23,7 @@ true - + $(DefineConstants);IS_CORECLR true @@ -69,7 +69,7 @@ true true - snupkg + snupkg $(NupkgOutputDirectory) true @@ -255,7 +255,7 @@ $(AssemblyName).dll $(PublishOutputDirectory)$(TargetFramework)\DotnetToolSettings.xml - + - 6.9.1 - 2.1.26 + 6.12.1 + 2.1.38 2.0.0 2.0.0 - + NupkgWrench diff --git a/src/NupkgWrench/NupkgWrench.csproj b/src/NupkgWrench/NupkgWrench.csproj index 52b9fc7..0311e69 100644 --- a/src/NupkgWrench/NupkgWrench.csproj +++ b/src/NupkgWrench/NupkgWrench.csproj @@ -3,7 +3,7 @@ - net6.0;net8.0 + net6.0;net8.0;net9.0 diff --git a/test/NupkgWrench.Tests/NupkgWrench.Tests.csproj b/test/NupkgWrench.Tests/NupkgWrench.Tests.csproj index 6445c3e..8dbc502 100644 --- a/test/NupkgWrench.Tests/NupkgWrench.Tests.csproj +++ b/test/NupkgWrench.Tests/NupkgWrench.Tests.csproj @@ -3,7 +3,7 @@ - net6.0;net8.0 + net6.0;net8.0;net9.0 diff --git a/test/Test.Common/Test.Common.csproj b/test/Test.Common/Test.Common.csproj index 9a564ac..0d0efc7 100644 --- a/test/Test.Common/Test.Common.csproj +++ b/test/Test.Common/Test.Common.csproj @@ -16,6 +16,12 @@ + + + + + +