Skip to content

Commit

Permalink
(#2998) net5.0 removal
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Mar 10, 2022
1 parent 5078f28 commit d4b9a49
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
targetFramework: [net48, net5.0, net6.0, netcoreapp3.1]
targetFramework: [net48, net6.0, netcoreapp3.1]
fail-fast: false

steps:
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '3.1', '5.0', '6.0' ]
targetFramework: [ '3.1', '6.0' ]
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ]
fail-fast: false

Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
targetFramework: [ '3.1', '5.0', '6.0' ]
targetFramework: [ '3.1', '6.0' ]
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ]
fail-fast: false

Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsDotnetToolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsDotnetToolTest))]
[TaskDescription("Tests the dotnet global tool in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsDotnetToolTest : FrostingTask<BuildContext>
Expand Down
3 changes: 1 addition & 2 deletions build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsMsBuildCoreTest))]
[TaskDescription("Tests the msbuild package in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsMsBuildCoreTest : FrostingTask<BuildContext>
Expand Down Expand Up @@ -36,7 +36,6 @@ public override void Run(BuildContext context)
targetFramework = targetFramework switch
{
Constants.Version31 => $"netcoreapp{targetFramework}",
Constants.Version50 => $"net{targetFramework}",
Constants.Version60 => $"net{targetFramework}",
_ => targetFramework
};
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override void Run(BuildContext context)
var nugetSource = context.MakeAbsolute(Paths.Nuget).FullPath;

context.Information("\nTesting msbuild task with dotnet build (for .net core)\n");
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion50, Constants.NetVersion60 };
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion60 };
foreach (var framework in frameworks)
{
var dotnetMsBuildSettings = new DotNetMSBuildSettings();
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsNativeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsNativeTest))]
[TaskDescription("Tests the native executables in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsPrepare))]
public class ArtifactsNativeTest : FrostingTask<BuildContext>
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsPrepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsPrepare))]
[TaskDescription("Pulls the docker images needed for testing the artifacts")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
public class ArtifactsPrepare : FrostingTask<BuildContext>
{
Expand Down
2 changes: 1 addition & 1 deletion build/artifacts/Tasks/ArtifactsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
[TaskName(nameof(ArtifactsTest))]
[TaskDescription("Tests packages in docker container")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(ArtifactsNativeTest))]
[IsDependentOn(typeof(ArtifactsDotnetToolTest))]
Expand Down
4 changes: 2 additions & 2 deletions build/build/Tasks/Test/UnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Build.Tasks;

[TaskName(nameof(UnitTest))]
[TaskDescription("Run the unit tests")]
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion50, Constants.NetVersion60, Constants.CoreFxVersion31, Constants.FullFxVersion48)]
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion60, Constants.CoreFxVersion31, Constants.FullFxVersion48)]
[IsDependentOn(typeof(Build))]
public class UnitTest : FrostingTask<BuildContext>
{
Expand All @@ -17,7 +17,7 @@ public class UnitTest : FrostingTask<BuildContext>
public override void Run(BuildContext context)
{
var dotnetTarget = context.Argument(Arguments.DotnetTarget, string.Empty);
var frameworks = new[] { Constants.CoreFxVersion31, Constants.FullFxVersion48, Constants.NetVersion50, Constants.NetVersion60 };
var frameworks = new[] { Constants.CoreFxVersion31, Constants.FullFxVersion48, Constants.NetVersion60 };
if (!string.IsNullOrWhiteSpace(dotnetTarget))
{
if (!frameworks.Contains(dotnetTarget, StringComparer.OrdinalIgnoreCase))
Expand Down
4 changes: 1 addition & 3 deletions build/common/Utilities/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ public class Constants
public const string Repository = "GitVersion";

public const string Version60 = "6.0";
public const string Version50 = "5.0";
public const string Version31 = "3.1";

public const string NetVersion50 = "net5.0";
public const string NetVersion60 = "net6.0";
public const string CoreFxVersion31 = "netcoreapp3.1";
public const string FullFxVersion48 = "net48";

public const string NoMono = "NoMono";
public const string NoNet48 = "NoNet48";

public static readonly string[] VersionsToBuild = { Version60, Version50, Version31 };
public static readonly string[] VersionsToBuild = { Version60, Version31 };
public static readonly Architecture[] ArchToBuild = { Architecture.Amd64, Architecture.Arm64 };
public static readonly string[] DistrosToSkip = { Alpine312, Alpine313, Alpine314, Centos7 };

Expand Down
2 changes: 1 addition & 1 deletion build/common/Utilities/DockerContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private static IEnumerable<string> GetDockerTags(this BuildContextBase context,
$"{name}:{context.Version.SemVersion}-{distro}-{targetFramework}",
};

if (distro == Constants.DockerDistroLatest && targetFramework == Constants.Version50)
if (distro == Constants.DockerDistroLatest && targetFramework == Constants.Version60)
{
tags.AddRange(new[]
{
Expand Down
2 changes: 1 addition & 1 deletion build/docker/Tasks/DockerBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerBuild))]
[TaskDescription("Build the docker images containing the GitVersion Tool")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)]
public class DockerBuild : FrostingTask<BuildContext>
Expand Down
2 changes: 1 addition & 1 deletion build/docker/Tasks/DockerManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerManifest))]
[TaskDescription("Publish the docker manifest containing the images for amd64 and arm64")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[IsDependentOn(typeof(DockerManifestInternal))]
public class DockerManifest : FrostingTask<BuildContext>
Expand Down
2 changes: 1 addition & 1 deletion build/docker/Tasks/DockerPublish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerPublish))]
[TaskDescription("Publish the docker images containing the GitVersion Tool")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)]
[IsDependentOn(typeof(DockerPublishInternal))]
Expand Down
2 changes: 1 addition & 1 deletion build/docker/Tasks/DockerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Docker.Tasks;
[TaskName(nameof(DockerTest))]
[TaskDescription("Test the docker images containing the GitVersion Tool")]
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
[TaskArgument(Arguments.Architecture, Constants.Amd64, Constants.Arm64)]
[IsDependentOn(typeof(DockerBuild))]
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.App.Tests/GitVersion.App.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net6.0</TargetFrameworks>

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.App/GitVersion.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>GitVersion</RootNamespace>
<AssemblyName>gitversion</AssemblyName>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net6.0</TargetFrameworks>

<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace System.Runtime.CompilerServices;

#if !NET5_0 && !NET6_0
#if !NET6_0

/// <summary>
/// Allows capturing of the expressions passed to a method.
Expand Down
8 changes: 1 addition & 7 deletions src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net6.0</TargetFrameworks>

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand All @@ -12,12 +12,6 @@
<PackageReference Include="Microsoft.Build" Version="16.9.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Buildalyzer" Version="3.2.8" />
<PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
<PackageReference Include="Microsoft.Build" Version="16.11.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Buildalyzer" Version="3.2.8" />
<PackageReference Include="MSBuild.ProjectCreation" Version="6.3.3" />
Expand Down
4 changes: 0 additions & 4 deletions src/GitVersion.MsBuild/nuget-files.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
<PropertyGroup>
<PublishTask_net48>../GitVersion.App/bin/$(Configuration)/net48</PublishTask_net48>
<PublishTask_netcore31>../GitVersion.App/bin/$(Configuration)/netcoreapp3.1/publish</PublishTask_netcore31>
<PublishTask_net50>../GitVersion.App/bin/$(Configuration)/net5.0/publish</PublishTask_net50>
<PublishTask_net60>../GitVersion.App/bin/$(Configuration)/net6.0/publish</PublishTask_net60>
<Target_net48>tools/net48</Target_net48>
<Target_netcore31>tools/netcoreapp3.1</Target_netcore31>
<Target_net50>tools/net5.0</Target_net50>
<Target_net60>tools/net6.0</Target_net60>
</PropertyGroup>
<ItemGroup Condition="$(IsPackaging) != ''">
Expand All @@ -17,12 +15,10 @@

<None Include="$(PublishTask_net48)/**/*" Pack="true" PackagePath="$(Target_net48)" />
<None Include="$(PublishTask_netcore31)/**/*" Pack="true" PackagePath="$(Target_netcore31)" />
<None Include="$(PublishTask_net50)/**/*" Pack="true" PackagePath="$(Target_net50)" />
<None Include="$(PublishTask_net60)/**/*" Pack="true" PackagePath="$(Target_net60)" />

<None Include="bin/$(Configuration)/netstandard2.0/GitVersion.MsBuild.*" Pack="true" PackagePath="$(Target_net48)" />
<None Include="bin/$(Configuration)/netstandard2.0/GitVersion.MsBuild.*" Pack="true" PackagePath="$(Target_netcore31)" />
<None Include="bin/$(Configuration)/netstandard2.0/GitVersion.MsBuild.*" Pack="true" PackagePath="$(Target_net50)" />
<None Include="bin/$(Configuration)/netstandard2.0/GitVersion.MsBuild.*" Pack="true" PackagePath="$(Target_net60)" />
</ItemGroup>
</Project>

0 comments on commit d4b9a49

Please sign in to comment.