Skip to content

Commit

Permalink
Merge pull request #3993 from Marusyk/rmarusyk/remove-tfm-3.1-5.0
Browse files Browse the repository at this point in the history
Remove .NET Core 3.1 and .NET 5 TFM
  • Loading branch information
devlead committed Oct 24, 2022
2 parents 9504860 + ac25392 commit 3490356
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 50 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +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:
dotnet-version: '5.0.x'

- name: Install .NET SDK 6.0.x
uses: actions/setup-dotnet@v1
with:
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ 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: .\dotnet-install.ps1 -Channel 6.0 -InstallDir .\.dotnet
- ps: .\build.ps1 --target="AppVeyor"

# Tests
Expand Down
6 changes: 2 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ 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[] { "net6.0", "net7.0" })
{
FilePath testResultsPath = MakeAbsolute(parameters.Paths.Directories.TestResults
.CombineWithFilePath($"{project.GetFilenameWithoutExtension()}_{framework}_TestResults.xml"));
.CombineWithFilePath($"{project.GetFilenameWithoutExtension()}_{framework}_TestResults.xml"));
DotNetTest(project.FullPath, new DotNetTestSettings
{
Expand Down Expand Up @@ -390,8 +390,6 @@ Task("Run-Integration-Tests")
.DeferOnError()
.DoesForEach<BuildParameters, FilePath>(
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()
},
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Frosting.Template/Cake.Frosting.Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>Cake.Frosting.Template</AssemblyName>
<Title>Cake.Frosting templates for the .NET SDK.</Title>
<Description>Cake.Frosting templates for the .NET SDK.</Description>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,24 @@
"type": "project"
},
"groupIdentity": "Cake",
"description": "Create a Cake.Frosting build project."
"description": "Create a Cake.Frosting build project.",
"symbols": {
"framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"defaultValue": "net7.0",
"replaces": "TargetFrameworkValue",
"choices": [
{
"choice": "net6.0",
"description": "Target .NET 6"
},
{
"choice": "net7.0",
"description": "Target .NET 7"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>TargetFrameworkValue</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="2.2.0" />
<PackageReference Include="Cake.Frosting" Version="3.0.0" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/Cake.NuGet/Cake.NuGet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<PackageReference Include="NuGet.Resolver" Version="6.3.1" />
<PackageReference Include="NuGet.Common" Version="6.3.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Condition="'$(TargetFramework)' == 'netcoreapp3.1'" Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/Cake/Cake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@
<PackageReference Include="Autofac" Version="6.4.0" />
<PackageReference Include="Basic.Reference.Assemblies.Net70" Version="1.3.0" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Basic.Reference.Assemblies.Net60" Version="1.3.0" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Basic.Reference.Assemblies.Net50" Version="1.3.0" Condition="'$(TargetFramework)' == 'net5.0'" />
<PackageReference Include="Basic.Reference.Assemblies.NetCoreApp31" Version="1.3.0" Condition="'$(TargetFramework)' == 'netcoreapp3.1'" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ public Assembly[] GetReferenceAssemblies()
IEnumerable<Assembly> TryGetReferenceAssemblies()
{
foreach (var reference in
#if NETCOREAPP3_1
Basic.Reference.Assemblies.NetCoreApp31.All)
#elif NET5_0
Basic.Reference.Assemblies.Net50.All)
#elif NET6_0
#if NET6_0
Basic.Reference.Assemblies.Net60.All)
#else
Basic.Reference.Assemblies.Net70.All)
Expand Down
4 changes: 2 additions & 2 deletions src/Shared.msbuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<!-- General package metadata -->
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<PackageId>$(AssemblyName)</PackageId>
<Copyright>Copyright (c) .NET Foundation and contributors</Copyright>
<Authors>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</Authors>
Expand All @@ -17,7 +17,7 @@
</PropertyGroup>

<!-- Define .NET Core constants -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' ">
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' ">
<NetStandardImplicitPackageVersion>2.0.0</NetStandardImplicitPackageVersion>
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
<DebugType>portable</DebugType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Setup(
Task("ValidateEnvironment")
.DoesForEach<BuildData, string>(
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"
},
Expand All @@ -26,9 +24,7 @@ Task("ValidatePath")
.DoesForEach<BuildData, string>(
new [] {
"Cake\\WTool\\Wtools\\Wnet7\\W0",
"Cake\\WTool\\Wtools\\Wnet6\\W0",
"Cake\\WTool\\Wtools\\Wnet5\\W0",
"Cake\\WTool\\Wtools\\Wnetcoreapp3\\W1"
"Cake\\WTool\\Wtools\\Wnet6\\W0"
},
(data, path) => Assert.Matches(path, data.Path)
);
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/Cake.Common/Tools/DotNet/DotNetAliases.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#load "./../../../utilities/xunit.cake"
#load "./../../../utilities/paths.cake"

var environmentVariables = new Dictionary<string, string> {
{ "DOTNET_ROLL_FORWARD", "Major" }
};

Task("Cake.Common.Tools.TextTransform.TextTransformAliases.TransformTemplate.Setup")
.Does(() =>
{
var t4Path = Context.Tools.Resolve("t4") ?? Context.Tools.Resolve("t4.exe");
if (t4Path == null)
{
DotNetTool(null, "tool", "install --tool-path ./tools dotnet-t4 --version \"2.2.0-preview-0020-g990c44075e\" --add-source \"https://pkgs.dev.azure.com/cake-build/Cake/_packaging/cake/nuget/v3/index.json\"");
DotNetTool(null, "tool", "install --tool-path ./tools dotnet-t4 --version \"2.2.1\"");
}
});

Expand All @@ -28,7 +32,8 @@ Task("Cake.Common.Tools.TextTransform.TextTransformAliases.TransformTemplate.Pro
Properties = {
["FirstName"] = "John",
["LastName"] = "Doe"
}
},
EnvironmentVariables = environmentVariables
};
var expect = "Hello John Doe!";
Expand All @@ -53,7 +58,8 @@ Task("Cake.Common.Tools.TextTransform.TextTransformAliases.TransformTemplate.Cla
var settings = new TextTransformSettings {
OutputFile = targetFile,
Class = "HelloWorld"
Class = "HelloWorld",
EnvironmentVariables = environmentVariables
};
var expect = @"public partial class HelloWorld : HelloWorldBase {";
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/Cake.Core/Scripting/AddinDirective.cake
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +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"
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/Cake.Core/Scripting/DefineDirective.cake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Task("Cake.Core.Scripting.DefineDirective.Cake")
Assert.True(cake);
});

#if NET5_0 || NET6_0 || NET7_0
#if NET6_0 || NET7_0
Task("Cake.Core.Scripting.DefineDirective.C#9")
.Does(() =>
{
Expand Down Expand Up @@ -117,7 +117,7 @@ public record CSharpNine(bool IsNine);
//////////////////////////////////////////////////////////////////////////////

Task("Cake.Core.Scripting.DefineDirective")
#if NET5_0 || NET6_0 || NET7_0
#if NET6_0 || NET7_0
.IsDependentOn("Cake.Core.Scripting.DefineDirective.C#9")
#endif
#if NET6_0 || NET7_0
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Cake.Frosting/build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<PackAsTool>true</PackAsTool>

<!-- Make sure start same folder .NET Core CLI and Visual Studio -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\hwapp.common\hwapp.common.csproj" />
Expand Down

0 comments on commit 3490356

Please sign in to comment.