From 7ca1b0c58c261104504676e37983b662b33607fa Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 1 Mar 2024 14:18:14 +0000 Subject: [PATCH] Update to .NET 9 preview 1 - Update to preview 1 of the .NET 9 SDK. - Target `net8.0` and `net9.0` in tests, samples and benchmarks. - Remove `net6.0` and `net7.0` targets from tests, samples and benchmarks. - Simplify AoT properties. - Only analyse for AoT for .NET 8+ to resolve new warning. - Force docfx to use .NET 9 SDK. - Fix new IDE0034 warning. --- .github/workflows/gh-pages.yml | 3 +++ Directory.Packages.props | 2 +- bench/Polly.Benchmarks/Polly.Benchmarks.csproj | 2 +- bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj | 2 +- bench/benchmarks.ps1 | 2 +- global.json | 2 +- samples/Chaos/Chaos.csproj | 2 +- samples/DependencyInjection/DependencyInjection.csproj | 2 +- samples/Extensibility/Extensibility.csproj | 2 +- samples/GenericPipelines/GenericPipelines.csproj | 2 +- samples/Intro/Intro.csproj | 2 +- samples/Retries/Retries.csproj | 2 +- src/Polly.Core/Polly.Core.csproj | 6 +----- src/Polly.Extensions/Polly.Extensions.csproj | 6 +----- src/Polly.RateLimiting/Polly.RateLimiting.csproj | 6 +----- src/Snippets/Snippets.csproj | 2 +- test/Polly.AotTest/Polly.AotTest.csproj | 2 +- test/Polly.Core.Tests/Polly.Core.Tests.csproj | 2 +- test/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj | 2 +- .../Polly.RateLimiting.Tests.csproj | 2 +- test/Polly.Specs/Polly.Specs.csproj | 2 +- test/Polly.TestUtils/Polly.TestUtils.csproj | 2 +- test/Polly.Testing.Tests/Polly.Testing.Tests.csproj | 2 +- 23 files changed, 25 insertions(+), 34 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 8ac703a1610..bae2fc2b5cd 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -43,6 +43,9 @@ jobs: uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 - name: Generate documentation + env: + DOTNET_ROLL_FORWARD: LatestMajor + DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1 run: | dotnet tool restore dotnet build --configuration Release /p:SKIP_POLLY_ANALYZERS=true diff --git a/Directory.Packages.props b/Directory.Packages.props index 3f4b4cd259f..b12a048fb57 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -22,7 +22,7 @@ - + diff --git a/bench/Polly.Benchmarks/Polly.Benchmarks.csproj b/bench/Polly.Benchmarks/Polly.Benchmarks.csproj index 0fc02332e3f..9f63203a197 100644 --- a/bench/Polly.Benchmarks/Polly.Benchmarks.csproj +++ b/bench/Polly.Benchmarks/Polly.Benchmarks.csproj @@ -2,7 +2,7 @@ false Exe - net6.0;net7.0;net8.0 + net8.0;net9.0 enable Benchmark $(NoWarn);CA1822;SA1414;IDE0060 diff --git a/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj b/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj index fd0ec851ece..8c206b165e9 100644 --- a/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj +++ b/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj @@ -1,6 +1,6 @@  - net8.0;net7.0 + net9.0;net8.0 Polly true Benchmark diff --git a/bench/benchmarks.ps1 b/bench/benchmarks.ps1 index fbeec111321..4f7548d037d 100644 --- a/bench/benchmarks.ps1 +++ b/bench/benchmarks.ps1 @@ -20,6 +20,6 @@ if ($Interactive -ne $true) { $project = Join-Path "Polly.Core.Benchmarks" "Polly.Core.Benchmarks.csproj" -dotnet run --configuration $Configuration --framework net8.0 --project $project $additionalArgs +dotnet run --configuration $Configuration --framework net9.0 --project $project $additionalArgs exit $LASTEXITCODE diff --git a/global.json b/global.json index eba056a1caa..b207f0eabe9 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.201", + "version": "9.0.100-preview.1.24101.2", "allowPrerelease": false, "rollForward": "latestMajor" } diff --git a/samples/Chaos/Chaos.csproj b/samples/Chaos/Chaos.csproj index 829f96fb11b..1b979fddd1e 100644 --- a/samples/Chaos/Chaos.csproj +++ b/samples/Chaos/Chaos.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable Chaos diff --git a/samples/DependencyInjection/DependencyInjection.csproj b/samples/DependencyInjection/DependencyInjection.csproj index a588bb35037..f73ecdbafb0 100644 --- a/samples/DependencyInjection/DependencyInjection.csproj +++ b/samples/DependencyInjection/DependencyInjection.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/samples/Extensibility/Extensibility.csproj b/samples/Extensibility/Extensibility.csproj index 499481d3d4e..49e230a9337 100644 --- a/samples/Extensibility/Extensibility.csproj +++ b/samples/Extensibility/Extensibility.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/samples/GenericPipelines/GenericPipelines.csproj b/samples/GenericPipelines/GenericPipelines.csproj index 0dea364499d..caa321690bb 100644 --- a/samples/GenericPipelines/GenericPipelines.csproj +++ b/samples/GenericPipelines/GenericPipelines.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/samples/Intro/Intro.csproj b/samples/Intro/Intro.csproj index 499481d3d4e..49e230a9337 100644 --- a/samples/Intro/Intro.csproj +++ b/samples/Intro/Intro.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/samples/Retries/Retries.csproj b/samples/Retries/Retries.csproj index 499481d3d4e..49e230a9337 100644 --- a/samples/Retries/Retries.csproj +++ b/samples/Retries/Retries.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/src/Polly.Core/Polly.Core.csproj b/src/Polly.Core/Polly.Core.csproj index dc559e6103f..87d5cf5f18d 100644 --- a/src/Polly.Core/Polly.Core.csproj +++ b/src/Polly.Core/Polly.Core.csproj @@ -11,12 +11,8 @@ true true - - true - true - true + true - true diff --git a/src/Polly.Extensions/Polly.Extensions.csproj b/src/Polly.Extensions/Polly.Extensions.csproj index 87ad3501ee5..611ed12fb80 100644 --- a/src/Polly.Extensions/Polly.Extensions.csproj +++ b/src/Polly.Extensions/Polly.Extensions.csproj @@ -9,12 +9,8 @@ 100 true - - true - true - true + true - true diff --git a/src/Polly.RateLimiting/Polly.RateLimiting.csproj b/src/Polly.RateLimiting/Polly.RateLimiting.csproj index f06c8a674a1..789946e976c 100644 --- a/src/Polly.RateLimiting/Polly.RateLimiting.csproj +++ b/src/Polly.RateLimiting/Polly.RateLimiting.csproj @@ -9,12 +9,8 @@ 100 true - - true - true - true + true - true diff --git a/src/Snippets/Snippets.csproj b/src/Snippets/Snippets.csproj index efcf28ecefb..a5432022f89 100644 --- a/src/Snippets/Snippets.csproj +++ b/src/Snippets/Snippets.csproj @@ -2,7 +2,7 @@ Library - net8.0 + net9.0 enable enable Library diff --git a/test/Polly.AotTest/Polly.AotTest.csproj b/test/Polly.AotTest/Polly.AotTest.csproj index 06c8c79c498..153567151f2 100644 --- a/test/Polly.AotTest/Polly.AotTest.csproj +++ b/test/Polly.AotTest/Polly.AotTest.csproj @@ -5,7 +5,7 @@ true true true - net8.0 + net9.0;net8.0 diff --git a/test/Polly.Core.Tests/Polly.Core.Tests.csproj b/test/Polly.Core.Tests/Polly.Core.Tests.csproj index b982b9b6add..dfa7a0e0e45 100644 --- a/test/Polly.Core.Tests/Polly.Core.Tests.csproj +++ b/test/Polly.Core.Tests/Polly.Core.Tests.csproj @@ -1,6 +1,6 @@  - net8.0;net7.0;net6.0 + net9.0;net8.0 $(TargetFrameworks);net481 Test enable diff --git a/test/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj b/test/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj index c45f7a77232..80498676560 100644 --- a/test/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj +++ b/test/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj @@ -1,6 +1,6 @@  - net8.0;net7.0;net6.0 + net9.0;net8.0 $(TargetFrameworks);net481 Test enable diff --git a/test/Polly.RateLimiting.Tests/Polly.RateLimiting.Tests.csproj b/test/Polly.RateLimiting.Tests/Polly.RateLimiting.Tests.csproj index 412e2580fb0..23cf1166060 100644 --- a/test/Polly.RateLimiting.Tests/Polly.RateLimiting.Tests.csproj +++ b/test/Polly.RateLimiting.Tests/Polly.RateLimiting.Tests.csproj @@ -1,6 +1,6 @@  - net8.0;net7.0;net6.0 + net9.0;net8.0 $(TargetFrameworks);net481 Test enable diff --git a/test/Polly.Specs/Polly.Specs.csproj b/test/Polly.Specs/Polly.Specs.csproj index 5ed720b5290..ebca539b731 100644 --- a/test/Polly.Specs/Polly.Specs.csproj +++ b/test/Polly.Specs/Polly.Specs.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0;net8.0 + net8.0;net9.0 $(TargetFrameworks);net481 enable Test diff --git a/test/Polly.TestUtils/Polly.TestUtils.csproj b/test/Polly.TestUtils/Polly.TestUtils.csproj index 28fed5ec0e8..b1a41cf4c38 100644 --- a/test/Polly.TestUtils/Polly.TestUtils.csproj +++ b/test/Polly.TestUtils/Polly.TestUtils.csproj @@ -1,6 +1,6 @@  - net8.0;net7.0;net6.0 + net9.0;net8.0 $(TargetFrameworks);net481 Library enable diff --git a/test/Polly.Testing.Tests/Polly.Testing.Tests.csproj b/test/Polly.Testing.Tests/Polly.Testing.Tests.csproj index 7fd94fffdc4..5bd1053492c 100644 --- a/test/Polly.Testing.Tests/Polly.Testing.Tests.csproj +++ b/test/Polly.Testing.Tests/Polly.Testing.Tests.csproj @@ -1,6 +1,6 @@  - net8.0;net7.0;net6.0 + net9.0;net8.0 $(TargetFrameworks);net481 Test enable