Skip to content

Target .net 5.0 #2486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
strategy:
matrix:
os: [linux]
targetFramework: [ 3.1 ]
targetFramework: [ 3.1, 5.0 ]
distro: [ alpine.3.12-x64, centos.7-x64, debian.9-x64, debian.10-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ]
fail-fast: false

Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
strategy:
matrix:
os: [linux]
targetFramework: [ 3.1 ]
targetFramework: [ 3.1, 5.0 ]
distro: [ alpine.3.12-x64, centos.7-x64, debian.9-x64, debian.10-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ]
fail-fast: false

Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ stages:
name: Linux
vmImage: 'ubuntu-latest'
distros: [ alpine.3.12-x64, centos.7-x64, debian.9-x64, debian.10-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ]
dotnetVersions: [ '3.1' ]
dotnetVersions: [ 3.1, 5.0 ]

- stage: Artifact_Windows_Test
displayName: 'Artifacts Windows test'
Expand All @@ -83,7 +83,7 @@ stages:
name: Linux
vmImage: 'ubuntu-latest'
distros: [ alpine.3.12-x64, centos.7-x64, debian.9-x64, debian.10-x64, ubuntu.16.04-x64, ubuntu.18.04-x64, ubuntu.20.04-x64 ]
dotnetVersions: [ '3.1' ]
dotnetVersions: [ 3.1, 5.0 ]

- stage: Publish
displayName: 'Publish'
Expand Down
4 changes: 3 additions & 1 deletion build/artifacts-test.cake
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ Task("Artifacts-MsBuildCore-Test")

if (targetframework == "3.1") {
targetframework = $"netcoreapp{targetframework}";
} else if (targetframework == "5.0") {
targetframework = $"net{targetframework}";
}

var cmd = $"-file {rootPrefix}/scripts/Test-MsBuildCore.ps1 -version {version} -repoPath {rootPrefix}/repo/tests/integration/core -nugetPath {rootPrefix}/nuget -targetframework {targetframework}";
Expand All @@ -132,7 +134,7 @@ Task("Artifacts-MsBuildFull-Test")
var nugetSource = MakeAbsolute(parameters.Paths.Directories.NugetRoot).FullPath;

Information("\nTesting msbuild task with dotnet build (for .net core)\n");
var frameworks = new[] { parameters.CoreFxVersion31 };
var frameworks = new[] { parameters.CoreFxVersion31, parameters.NetVersion50 };
foreach(var framework in frameworks)
{
var dotnetCoreMsBuildSettings = new DotNetCoreMSBuildSettings();
Expand Down
6 changes: 2 additions & 4 deletions build/pack.cake
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ DirectoryPath PackPrepareNative(ICakeContext context, BuildParameters parameters

var settings = new DotNetCorePublishSettings
{
Framework = parameters.CoreFxVersion31,
Framework = parameters.NetVersion50,
Runtime = runtime,
NoRestore = false,
Configuration = parameters.Configuration,
Expand All @@ -151,9 +151,7 @@ DirectoryPath PackPrepareNative(ICakeContext context, BuildParameters parameters

settings.ArgumentCustomization =
arg => arg
.Append("/p:PublishSingleFile=true")
.Append("/p:PublishTrimmed=true")
.Append("/p:IncludeSymbolsInSingleFile=true");
.Append("/p:PublishSingleFile=true");

context.DotNetCorePublish("./src/GitVersionExe/GitVersionExe.csproj", settings);

Expand Down
6 changes: 3 additions & 3 deletions build/test.cake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Task("UnitTest")
.IsDependentOn("Build")
.Does<BuildParameters>((parameters) =>
{
var frameworks = new[] { parameters.CoreFxVersion31, parameters.FullFxVersion48 };
var frameworks = new[] { parameters.CoreFxVersion31, parameters.FullFxVersion48, parameters.NetVersion50 };
var testResultsPath = parameters.Paths.Directories.TestResultsOutput;

foreach(var framework in frameworks)
Expand Down Expand Up @@ -39,15 +39,15 @@ Task("UnitTest")
Exclude = new List<string> { "[GitVersion*.Tests]*" }
};

if (string.Equals(framework, parameters.FullFxVersion48))
if (string.Equals(framework, parameters.FullFxVersion48))
{
if (IsRunningOnUnix()) {
settings.Filter = "TestCategory!=NoMono";
} else {
settings.Filter = "TestCategory!=NoNet48";
}
}

DotNetCoreTest(project.FullPath, settings, coverletSettings);
});
}
Expand Down
2 changes: 1 addition & 1 deletion build/utils/artifacts.cake
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class DockerImages

public static DockerImages GetDockerImages(ICakeContext context, BuildParameters parameters)
{
var versions = new[] { "3.1" };
var versions = new[] { "3.1", "5.0" };
var distros = parameters.DockerDistros;

var dockerImages =
Expand Down
2 changes: 1 addition & 1 deletion build/utils/docker.cake
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ string[] GetDockerTags(DockerImage dockerImage, BuildParameters parameters) {
$"{name}:{parameters.Version.SemVersion}-{distro}-{targetframework}",
};

if (distro == "debian.10-x64" && targetframework == parameters.CoreFxVersion31) {
if (distro == "debian.10-x64" && targetframework == parameters.NetVersion50) {
tags.AddRange(new[] {
$"{name}:{parameters.Version.Version}",
$"{name}:{parameters.Version.SemVersion}",
Expand Down
1 change: 1 addition & 0 deletions build/utils/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class BuildParameters
public const string MainRepoOwner = "gittools";
public const string MainRepoName = "GitVersion";
public string CoreFxVersion31 { get; private set; } = "netcoreapp3.1";
public string NetVersion50 { get; private set; } = "net5.0";
public string FullFxVersion48 { get; private set; } = "net48";

public string DockerDistro { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
<GitVersionAssemblyFile>$(MSBuildThisFileDirectory)netcoreapp3.1/GitVersion.MsBuild.dll</GitVersionAssemblyFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net5.0'">
<GitVersionFileExe>dotnet $(MSBuildThisFileDirectory)net5.0/gitversion.dll</GitVersionFileExe>
<GitVersionAssemblyFile>$(MSBuildThisFileDirectory)net5.0/GitVersion.MsBuild.dll</GitVersionAssemblyFile>
</PropertyGroup>

<PropertyGroup>
<DisableGitVersionTask Condition=" '$(DisableGitVersionTask)' == '' ">false</DisableGitVersionTask>

Expand Down
4 changes: 4 additions & 0 deletions src/GitVersion.MsBuild/nuget-files.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<PropertyGroup>
<PublishTask_net48>../GitVersionExe/bin/$(Configuration)/net48</PublishTask_net48>
<PublishTask_netcore31>../GitVersionExe/bin/$(Configuration)/netcoreapp3.1/publish</PublishTask_netcore31>
<PublishTask_net50>../GitVersionExe/bin/$(Configuration)/net5.0/publish</PublishTask_net50>
<Target_net48>tools/net48</Target_net48>
<Target_netcore31>tools/netcoreapp3.1</Target_netcore31>
<Target_net50>tools/net5.0</Target_net50>
</PropertyGroup>
<ItemGroup Condition="$(IsPackaging) != ''">
<None Include="msbuild/tools/*.*" Pack="true" PackagePath="tools" />
Expand All @@ -13,8 +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="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)" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/GitVersionCore.Tests/GitVersionCore.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</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net5.0</TargetFrameworks>

<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionExe.Tests/GitVersionExe.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</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net5.0</TargetFrameworks>

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionExe/GitVersionExe.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</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DocumentationFile>bin\$(Configuration)\GitVersion.xml</DocumentationFile>
Expand Down