From 60510fb3aa38a9caf1cff1b337be185275fc489c Mon Sep 17 00:00:00 2001 From: Roman Marusyk Date: Mon, 17 Oct 2022 23:31:03 +0300 Subject: [PATCH] Remove .NET Core 3.1 TFM. Fixes #3972 --- .github/workflows/build.yml | 5 ----- appveyor.yml | 1 - build.cake | 3 +-- .../Cake.Frosting.Template.csproj | 2 +- .../templates/cakefrosting/build/Build.csproj | 2 +- src/Cake.NuGet/Cake.NuGet.csproj | 1 - src/Cake/Cake.csproj | 1 - .../Scripting/ReferenceAssemblyResolver.cs | 4 +--- src/Shared.msbuild | 4 ++-- .../GitHubActions/ValidateGitHubActionsProvider.cake | 4 +--- .../Cake.Common/Tools/DotNet/DotNetAliases.cake | 10 +++++----- .../Tools/DotNetCore/DotNetCoreAliases.cake | 10 +++++----- .../Cake.Core/Scripting/AddinDirective.cake | 1 - tests/integration/Cake.Frosting/build/Build.csproj | 2 +- .../Tools/DotNet/hwapp.tests/hwapp.tests.csproj | 2 +- .../Cake.Common/Tools/DotNet/hwapp/hwapp.csproj | 2 +- 16 files changed, 20 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dc34357cd..135e343ee9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,11 +21,6 @@ jobs: - name: Fetch all history for all tags and branches run: git fetch --prune --unshallow - - name: Install .NET Core SDK 3.1.x - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - - name: Install .NET Core SDK 5.0.x uses: actions/setup-dotnet@v1 with: diff --git a/appveyor.yml b/appveyor.yml index 0275dc7372..655e82463a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,6 @@ init: build_script: - ps: Invoke-RestMethod -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1' - ps: New-Item -Path .\.dotnet -ItemType Directory -Force | Out-Null - - ps: .\dotnet-install.ps1 -Channel 3.1 -InstallDir .\.dotnet - ps: .\dotnet-install.ps1 -Channel 5.0 -InstallDir .\.dotnet - ps: .\build.ps1 --target="AppVeyor" diff --git a/build.cake b/build.cake index a23babdc0b..94ea0b9e2a 100644 --- a/build.cake +++ b/build.cake @@ -123,7 +123,7 @@ Task("Run-Unit-Tests") () => GetFiles("./src/**/*.Tests.csproj"), (parameters, project, context) => { - foreach(var framework in new[] { "netcoreapp3.1", "net5.0", "net6.0", "net7.0" }) + foreach(var framework in new[] { "net5.0", "net6.0", "net7.0" }) { FilePath testResultsPath = MakeAbsolute(parameters.Paths.Directories.TestResults .CombineWithFilePath($"{project.GetFilenameWithoutExtension()}_{framework}_TestResults.xml")); @@ -390,7 +390,6 @@ Task("Run-Integration-Tests") .DeferOnError() .DoesForEach( parameters => new[] { - GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/netcoreapp3.1/**/Cake.dll").Single(), GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net5.0/**/Cake.dll").Single(), GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net6.0/**/Cake.dll").Single(), GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net7.0/**/Cake.dll").Single() diff --git a/src/Cake.Frosting.Template/Cake.Frosting.Template.csproj b/src/Cake.Frosting.Template/Cake.Frosting.Template.csproj index 15a11e11f3..b2d7b86f2e 100644 --- a/src/Cake.Frosting.Template/Cake.Frosting.Template.csproj +++ b/src/Cake.Frosting.Template/Cake.Frosting.Template.csproj @@ -5,7 +5,7 @@ Cake.Frosting.Template Cake.Frosting templates for the .NET SDK. Cake.Frosting templates for the .NET SDK. - netcoreapp3.1 + net7.0 true false content diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj b/src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj index cc0d1f730b..0030f6820a 100644 --- a/src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj +++ b/src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net7.0 $(MSBuildProjectDirectory) diff --git a/src/Cake.NuGet/Cake.NuGet.csproj b/src/Cake.NuGet/Cake.NuGet.csproj index 9bfd900963..a49292d170 100644 --- a/src/Cake.NuGet/Cake.NuGet.csproj +++ b/src/Cake.NuGet/Cake.NuGet.csproj @@ -25,7 +25,6 @@ - diff --git a/src/Cake/Cake.csproj b/src/Cake/Cake.csproj index ab43e32f64..719521e3bf 100644 --- a/src/Cake/Cake.csproj +++ b/src/Cake/Cake.csproj @@ -33,6 +33,5 @@ - \ No newline at end of file diff --git a/src/Cake/Infrastructure/Scripting/ReferenceAssemblyResolver.cs b/src/Cake/Infrastructure/Scripting/ReferenceAssemblyResolver.cs index 80d032f250..1e239e1b46 100644 --- a/src/Cake/Infrastructure/Scripting/ReferenceAssemblyResolver.cs +++ b/src/Cake/Infrastructure/Scripting/ReferenceAssemblyResolver.cs @@ -22,9 +22,7 @@ public Assembly[] GetReferenceAssemblies() IEnumerable TryGetReferenceAssemblies() { foreach (var reference in -#if NETCOREAPP3_1 - Basic.Reference.Assemblies.NetCoreApp31.All) -#elif NET5_0 +#if NET5_0 Basic.Reference.Assemblies.Net50.All) #elif NET6_0 Basic.Reference.Assemblies.Net60.All) diff --git a/src/Shared.msbuild b/src/Shared.msbuild index 69c2b60e18..46840f2493 100644 --- a/src/Shared.msbuild +++ b/src/Shared.msbuild @@ -1,7 +1,7 @@ - netcoreapp3.1;net5.0;net6.0;net7.0 + net5.0;net6.0;net7.0 $(AssemblyName) Copyright (c) .NET Foundation and contributors Patrik Svensson, Mattias Karlsson, Gary Ewan Park, Alistair Chapman, Martin Björkström, Dave Glick, Pascal Berger, Jérémie Desautels, Enrico Campidoglio, C. Augusto Proiete, Nils Andresen, and contributors @@ -17,7 +17,7 @@ - + 2.0.0 $(DefineConstants);NETCORE portable diff --git a/tests/integration/Cake.Common/Build/GitHubActions/ValidateGitHubActionsProvider.cake b/tests/integration/Cake.Common/Build/GitHubActions/ValidateGitHubActionsProvider.cake index 25c014671b..7de31449e8 100644 --- a/tests/integration/Cake.Common/Build/GitHubActions/ValidateGitHubActionsProvider.cake +++ b/tests/integration/Cake.Common/Build/GitHubActions/ValidateGitHubActionsProvider.cake @@ -14,7 +14,6 @@ Setup( Task("ValidateEnvironment") .DoesForEach( data => new [] { - $"CAKE_{data.OS}_NETCOREAPP_3_1_VERSION", $"CAKE_{data.OS}_NETCOREAPP_5_0_VERSION", $"CAKE_{data.OS}_NETCOREAPP_6_0_VERSION", $"CAKE_{data.OS}_NETCOREAPP_7_0_VERSION" @@ -27,8 +26,7 @@ Task("ValidatePath") new [] { "Cake\\WTool\\Wtools\\Wnet7\\W0", "Cake\\WTool\\Wtools\\Wnet6\\W0", - "Cake\\WTool\\Wtools\\Wnet5\\W0", - "Cake\\WTool\\Wtools\\Wnetcoreapp3\\W1" + "Cake\\WTool\\Wtools\\Wnet5\\W0" }, (data, path) => Assert.Matches(path, data.Path) ); diff --git a/tests/integration/Cake.Common/Tools/DotNet/DotNetAliases.cake b/tests/integration/Cake.Common/Tools/DotNet/DotNetAliases.cake index bba4a7b6a0..68b058a6d6 100644 --- a/tests/integration/Cake.Common/Tools/DotNet/DotNetAliases.cake +++ b/tests/integration/Cake.Common/Tools/DotNet/DotNetAliases.cake @@ -34,7 +34,7 @@ Task("Cake.Common.Tools.DotNet.DotNetAliases.DotNetBuild") // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); var project = path.CombineWithFilePath("hwapp/hwapp.csproj"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/net7.0/hwapp.dll"); // When DotNetBuild(project.FullPath); @@ -61,7 +61,7 @@ Task("Cake.Common.Tools.DotNet.DotNetAliases.DotNetVSTest") { // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); - var assembly = path.CombineWithFilePath("hwapp.tests/bin/Debug/netcoreapp3.1/hwapp.tests.dll"); + var assembly = path.CombineWithFilePath("hwapp.tests/bin/Debug/net7.0/hwapp.tests.dll"); // When DotNetVSTest(assembly.FullPath); @@ -184,7 +184,7 @@ Task("Cake.Common.Tools.DotNet.DotNetAliases.DotNetExecute") { // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/net7.0/hwapp.dll"); // When DotNetExecute(assembly); @@ -197,7 +197,7 @@ Task("Cake.Common.Tools.DotNet.DotNetAliases.DotNetClean") // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); var project = path.CombineWithFilePath("hwapp/hwapp.csproj"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/net7.0/hwapp.dll"); Assert.True(System.IO.File.Exists(assembly.FullPath)); // When @@ -214,7 +214,7 @@ Task("Cake.Common.Tools.DotNet.DotNetAliases.DotNetMSBuild") // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); var project = path.CombineWithFilePath("hwapp/hwapp.csproj"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/net7.0/hwapp.dll"); // When DotNetMSBuild(project.FullPath); diff --git a/tests/integration/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cake b/tests/integration/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cake index 10b3094451..40fc466ef2 100644 --- a/tests/integration/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cake +++ b/tests/integration/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cake @@ -34,7 +34,7 @@ Task("Cake.Common.Tools.DotNetCore.DotNetCoreAliases.DotNetCoreBuild") // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); var project = path.CombineWithFilePath("hwapp/hwapp.csproj"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/net7.0/hwapp.dll"); // When DotNetCoreBuild(project.FullPath); @@ -61,7 +61,7 @@ Task("Cake.Common.Tools.DotNetCore.DotNetCoreAliases.DotNetCoreVSTest") { // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); - var assembly = path.CombineWithFilePath("hwapp.tests/bin/Debug/netcoreapp3.1/hwapp.tests.dll"); + var assembly = path.CombineWithFilePath("hwapp.tests/bin/Debug/net7.0/hwapp.tests.dll"); // When DotNetCoreVSTest(assembly.FullPath); @@ -184,7 +184,7 @@ Task("Cake.Common.Tools.DotNetCore.DotNetCoreAliases.DotNetCoreExecute") { // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/net7.0/hwapp.dll"); // When DotNetCoreExecute(assembly); @@ -197,7 +197,7 @@ Task("Cake.Common.Tools.DotNetCore.DotNetCoreAliases.DotNetCoreClean") // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); var project = path.CombineWithFilePath("hwapp/hwapp.csproj"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/nnet7.0/hwapp.dll"); Assert.True(System.IO.File.Exists(assembly.FullPath)); // When @@ -214,7 +214,7 @@ Task("Cake.Common.Tools.DotNetCore.DotNetCoreAliases.DotNetCoreMSBuild") // Given var path = Paths.Temp.Combine("./Cake.Common/Tools/DotNet"); var project = path.CombineWithFilePath("hwapp/hwapp.csproj"); - var assembly = path.CombineWithFilePath("hwapp/bin/Debug/netcoreapp3.1/hwapp.dll"); + var assembly = path.CombineWithFilePath("hwapp/bin/Debug/net7.0/hwapp.dll"); // When DotNetCoreMSBuild(project.FullPath); diff --git a/tests/integration/Cake.Core/Scripting/AddinDirective.cake b/tests/integration/Cake.Core/Scripting/AddinDirective.cake index a6d7f5847c..5abeecc796 100644 --- a/tests/integration/Cake.Core/Scripting/AddinDirective.cake +++ b/tests/integration/Cake.Core/Scripting/AddinDirective.cake @@ -23,7 +23,6 @@ Task("Cake.Core.Scripting.AddinDirective.LoadTargetedAddin") .SetTargetFramework( cake switch { - FilePath netCoreApp3_1Path when netCoreApp3_1Path.FullPath.Contains("netcoreapp3.1") => "netcoreapp3.1", FilePath net5_0Path when net5_0Path.FullPath.Contains("net5.0") => "net5.0", FilePath net6_0Path when net6_0Path.FullPath.Contains("net6.0") => "net6.0", _ => "net7.0" diff --git a/tests/integration/Cake.Frosting/build/Build.csproj b/tests/integration/Cake.Frosting/build/Build.csproj index 071df4a56e..17b86681dd 100644 --- a/tests/integration/Cake.Frosting/build/Build.csproj +++ b/tests/integration/Cake.Frosting/build/Build.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1;net5.0;net6.0;net7.0 + net5.0;net6.0;net7.0 true diff --git a/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp.tests/hwapp.tests.csproj b/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp.tests/hwapp.tests.csproj index ace9d98420..809b83300c 100644 --- a/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp.tests/hwapp.tests.csproj +++ b/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp.tests/hwapp.tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net7.0 false diff --git a/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp/hwapp.csproj b/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp/hwapp.csproj index ec73b81db9..c54cbbeb30 100644 --- a/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp/hwapp.csproj +++ b/tests/integration/resources/Cake.Common/Tools/DotNet/hwapp/hwapp.csproj @@ -1,7 +1,7 @@  Exe - netcoreapp3.1 + net7.0