Skip to content

Commit 2afa70d

Browse files
committed
Merge branch 'support/5.x' into main
2 parents da52067 + 6706400 commit 2afa70d

File tree

52 files changed

+391
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+391
-145
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
strategy:
130130
matrix:
131131
os: [windows-latest, ubuntu-latest, macos-latest]
132-
targetFramework: [net6.0, netcoreapp3.1]
132+
targetFramework: [net48, net5.0, net6.0, netcoreapp3.1]
133133
fail-fast: false
134134

135135
steps:
@@ -213,7 +213,7 @@ jobs:
213213
runs-on: ubuntu-latest
214214
strategy:
215215
matrix:
216-
targetFramework: [ '3.1', '6.0' ]
216+
targetFramework: [ '3.1', '5.0', '6.0' ]
217217
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 ]
218218
fail-fast: false
219219

@@ -277,7 +277,7 @@ jobs:
277277
runs-on: ubuntu-latest
278278
strategy:
279279
matrix:
280-
targetFramework: [ '3.1', '6.0' ]
280+
targetFramework: [ '3.1', '5.0', '6.0' ]
281281
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 ]
282282
fail-fast: false
283283

build/artifacts/Tasks/ArtifactsDotnetToolTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
55
[TaskName(nameof(ArtifactsDotnetToolTest))]
66
[TaskDescription("Tests the dotnet global tool in docker container")]
77
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
8-
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
8+
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
99
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
1010
[IsDependentOn(typeof(ArtifactsPrepare))]
1111
public class ArtifactsDotnetToolTest : FrostingTask<BuildContext>

build/artifacts/Tasks/ArtifactsMsBuildCoreTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
55
[TaskName(nameof(ArtifactsMsBuildCoreTest))]
66
[TaskDescription("Tests the msbuild package in docker container")]
77
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
8-
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
8+
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
99
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
1010
[IsDependentOn(typeof(ArtifactsPrepare))]
1111
public class ArtifactsMsBuildCoreTest : FrostingTask<BuildContext>
@@ -36,6 +36,7 @@ public override void Run(BuildContext context)
3636
targetFramework = targetFramework switch
3737
{
3838
Constants.Version31 => $"netcoreapp{targetFramework}",
39+
Constants.Version50 => $"net{targetFramework}",
3940
Constants.Version60 => $"net{targetFramework}",
4041
_ => targetFramework
4142
};

build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override void Run(BuildContext context)
2323
var nugetSource = context.MakeAbsolute(Paths.Nuget).FullPath;
2424

2525
context.Information("\nTesting msbuild task with dotnet build (for .net core)\n");
26-
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion60 };
26+
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion50, Constants.NetVersion60 };
2727
foreach (var framework in frameworks)
2828
{
2929
var dotnetMsBuildSettings = new DotNetMSBuildSettings();
@@ -43,5 +43,21 @@ public override void Run(BuildContext context)
4343
var netcoreExe = Paths.Integration.Combine("core").Combine("build").Combine(framework).CombineWithFilePath("app.dll");
4444
context.ValidateOutput("dotnet", netcoreExe.FullPath, context.Version.GitVersion.FullSemVer);
4545
}
46+
47+
context.Information("\nTesting msbuild task with msbuild (for full framework)\n");
48+
49+
var msBuildSettings = new MSBuildSettings
50+
{
51+
Verbosity = Verbosity.Minimal,
52+
Restore = true
53+
};
54+
55+
msBuildSettings.WithProperty("GitVersionMsBuildVersion", version);
56+
msBuildSettings.WithProperty("RestoreSource", nugetSource);
57+
58+
context.MSBuild("./tests/integration/full", msBuildSettings);
59+
60+
var fullExe = Paths.Integration.Combine("full").Combine("build").CombineWithFilePath("app.exe");
61+
context.ValidateOutput(fullExe.FullPath, null, context.Version.GitVersion.FullSemVer);
4662
}
4763
}

build/artifacts/Tasks/ArtifactsNativeTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
55
[TaskName(nameof(ArtifactsNativeTest))]
66
[TaskDescription("Tests the native executables in docker container")]
77
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
8-
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
8+
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
99
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
1010
[IsDependentOn(typeof(ArtifactsPrepare))]
1111
public class ArtifactsNativeTest : FrostingTask<BuildContext>

build/artifacts/Tasks/ArtifactsPrepare.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
55
[TaskName(nameof(ArtifactsPrepare))]
66
[TaskDescription("Pulls the docker images needed for testing the artifacts")]
77
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
8-
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
8+
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
99
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
1010
public class ArtifactsPrepare : FrostingTask<BuildContext>
1111
{

build/artifacts/Tasks/ArtifactsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Artifacts.Tasks;
55
[TaskName(nameof(ArtifactsTest))]
66
[TaskDescription("Tests packages in docker container")]
77
[TaskArgument(Arguments.DockerRegistry, Constants.DockerHub, Constants.GitHub)]
8-
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version60, Constants.Version31)]
8+
[TaskArgument(Arguments.DockerDotnetVersion, Constants.Version50, Constants.Version60, Constants.Version31)]
99
[TaskArgument(Arguments.DockerDistro, Constants.Alpine312, Constants.Debian10, Constants.Ubuntu2004)]
1010
[IsDependentOn(typeof(ArtifactsNativeTest))]
1111
[IsDependentOn(typeof(ArtifactsDotnetToolTest))]

build/build/Tasks/Test/UnitTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Build.Tasks;
88

99
[TaskName(nameof(UnitTest))]
1010
[TaskDescription("Run the unit tests")]
11-
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion60, Constants.CoreFxVersion31)]
11+
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion50, Constants.NetVersion60, Constants.CoreFxVersion31, Constants.FullFxVersion48)]
1212
[IsDependentOn(typeof(Build))]
1313
public class UnitTest : FrostingTask<BuildContext>
1414
{
@@ -17,7 +17,7 @@ public class UnitTest : FrostingTask<BuildContext>
1717
public override void Run(BuildContext context)
1818
{
1919
var dotnetTarget = context.Argument(Arguments.DotnetTarget, string.Empty);
20-
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion60 };
20+
var frameworks = new[] { Constants.CoreFxVersion31, Constants.FullFxVersion48, Constants.NetVersion50, Constants.NetVersion60 };
2121
if (!string.IsNullOrWhiteSpace(dotnetTarget))
2222
{
2323
if (!frameworks.Contains(dotnetTarget, StringComparer.OrdinalIgnoreCase))
@@ -87,6 +87,11 @@ private static void TestProjectForTarget(BuildContext context, FilePath project,
8787
Exclude = new List<string> { "[GitVersion*.Tests]*", "[GitTools.Testing]*" }
8888
};
8989

90+
if (string.Equals(framework, Constants.FullFxVersion48))
91+
{
92+
settings.Filter = context.IsRunningOnUnix() ? $"TestCategory!={Constants.NoMono}" : $"TestCategory!={Constants.NoNet48}";
93+
}
94+
9095
context.DotNetTest(project.FullPath, settings, coverletSettings);
9196
}
9297
}

build/common/Utilities/Constants.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ public class Constants
66
public const string Repository = "GitVersion";
77

88
public const string Version60 = "6.0";
9+
public const string Version50 = "5.0";
910
public const string Version31 = "3.1";
1011

12+
public const string NetVersion50 = "net5.0";
1113
public const string NetVersion60 = "net6.0";
1214
public const string CoreFxVersion31 = "netcoreapp3.1";
15+
public const string FullFxVersion48 = "net48";
1316

14-
public static readonly string[] VersionsToBuild = { Version60, Version31 };
17+
public const string NoMono = "NoMono";
18+
public const string NoNet48 = "NoNet48";
19+
20+
public static readonly string[] VersionsToBuild = { Version60, Version50, Version31 };
1521
public static readonly Architecture[] ArchToBuild = { Architecture.Amd64, Architecture.Arm64 };
1622
public static readonly string[] DistrosToSkip = { Alpine312, Alpine313, Alpine314, Centos7 };
1723

build/common/Utilities/DockerContextExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private static IEnumerable<string> GetDockerTags(this BuildContextBase context,
158158
$"{name}:{context.Version.SemVersion}-{distro}-{targetFramework}",
159159
};
160160

161-
if (distro == Constants.DockerDistroLatest && targetFramework == Constants.Version60)
161+
if (distro == Constants.DockerDistroLatest && targetFramework == Constants.Version50)
162162
{
163163
tags.AddRange(new[]
164164
{

0 commit comments

Comments
 (0)