Skip to content

Commit

Permalink
Remove .NET 5 TFM. Fixes cake-build#3949
Browse files Browse the repository at this point in the history
  • Loading branch information
Marusyk committed Oct 17, 2022
1 parent 60510fb commit 7fe9fe2
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 22 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ jobs:
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow

- 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
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 5.0 -InstallDir .\.dotnet
- ps: .\build.ps1 --target="AppVeyor"

# Tests
Expand Down
5 changes: 2 additions & 3 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[] { "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,7 +390,6 @@ Task("Run-Integration-Tests")
.DeferOnError()
.DoesForEach<BuildParameters, FilePath>(
parameters => new[] {
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
1 change: 0 additions & 1 deletion src/Cake/Cake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +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'" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ public Assembly[] GetReferenceAssemblies()
IEnumerable<Assembly> TryGetReferenceAssemblies()
{
foreach (var reference in
#if 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>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)' == '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,7 +14,6 @@ Setup(
Task("ValidateEnvironment")
.DoesForEach<BuildData, string>(
data => new [] {
$"CAKE_{data.OS}_NETCOREAPP_5_0_VERSION",
$"CAKE_{data.OS}_NETCOREAPP_6_0_VERSION",
$"CAKE_{data.OS}_NETCOREAPP_7_0_VERSION"
},
Expand All @@ -25,8 +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\\Wnet6\\W0"
},
(data, path) => Assert.Matches(path, data.Path)
);
Expand Down
1 change: 0 additions & 1 deletion tests/integration/Cake.Core/Scripting/AddinDirective.cake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Task("Cake.Core.Scripting.AddinDirective.LoadTargetedAddin")
.SetTargetFramework(
cake switch
{
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>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

0 comments on commit 7fe9fe2

Please sign in to comment.