Skip to content

Commit 5330bbb

Browse files
committed
GH-2095 - Target .net48 instead of .net472
1 parent c73300b commit 5330bbb

File tree

18 files changed

+26
-28
lines changed

18 files changed

+26
-28
lines changed

build/pack.cake

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Task("Pack-Prepare")
44
{
55
PackPrepareNative(Context, parameters);
66

7-
var frameworks = new[] { parameters.CoreFxVersion21, parameters.FullFxVersion472 };
7+
var frameworks = new[] { parameters.CoreFxVersion21, parameters.FullFxVersion48 };
88

99
// MsBuild Task
1010
foreach(var framework in frameworks)

build/test.cake

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Task("UnitTest")
55
.IsDependentOn("Build")
66
.Does<BuildParameters>((parameters) =>
77
{
8-
var frameworks = new[] { parameters.CoreFxVersion31, parameters.FullFxVersion472 };
8+
var frameworks = new[] { parameters.CoreFxVersion31, parameters.FullFxVersion48 };
99
var testResultsPath = parameters.Paths.Directories.TestResultsOutput;
1010

1111
foreach(var framework in frameworks)
@@ -39,7 +39,7 @@ Task("UnitTest")
3939
Exclude = new List<string> { "[GitVersion*.Tests]*", "[GitVersionTask.MsBuild]*" }
4040
};
4141

42-
if (IsRunningOnUnix() && string.Equals(framework, parameters.FullFxVersion472))
42+
if (IsRunningOnUnix() && string.Equals(framework, parameters.FullFxVersion48))
4343
{
4444
settings.Filter = "TestCategory!=NoMono";
4545
}

build/utils/parameters.cake

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class BuildParameters
1212
public const string MainRepoName = "GitVersion";
1313
public string CoreFxVersion21 { get; private set; } = "netcoreapp2.1";
1414
public string CoreFxVersion31 { get; private set; } = "netcoreapp3.1";
15-
public string FullFxVersion472 { get; private set; } = "net472";
15+
public string FullFxVersion48 { get; private set; } = "net48";
1616

1717
public string DockerDistro { get; private set; }
1818
public string DockerDotnetVersion { get; private set; }

src/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</None>
6767
</ItemGroup>
6868

69-
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
69+
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
7070
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
7171
</ItemGroup>
7272
</Project>

src/Docker/Readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# There are 4 variants of docker image
22

3-
- based on **microsoft/dotnet-framework:4.7.2-runtime** - Windows Full FX
3+
- based on **microsoft/dotnet-framework:4.8-runtime** - Windows Full FX
44
- based on **microsoft/dotnet:2.1-runtime** - Windows dotnet core
55
- based on **mono:5.18** - Linux Full FX - on mono
66
- based on **microsoft/dotnet:2.1-runtime** - Linux dotnet core
77
- based on **centos:7** - linux dotnet core
88

99
To run on windows container run this
10-
`docker run --rm -v "$(pwd):c:/repo" gittools/gitversion:latest-windows-net472 c:/repo`
10+
`docker run --rm -v "$(pwd):c:/repo" gittools/gitversion:latest-windows-net48 c:/repo`
1111

1212
`docker run --rm -v "$(pwd):c:/repo" gittools/gitversion:latest-windows-netcoreapp2.1 c:/repo`
1313

1414
To run on linux container run this
15-
`docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-linux-net472 /repo`
15+
`docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-linux-net48 /repo`
1616

1717
`docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-linux-netcoreapp2.1 /repo`

src/GitVersionCore.Tests/GitVersionCore.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>net48;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
55

66
<DebugType>full</DebugType>
77
<Optimize>false</Optimize>

src/GitVersionCore/GitVersionCore.csproj

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17+
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
18+
1719
<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)" />
1820
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" PrivateAssets="All" />
1921
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(PackageVersion_MicrosoftExtensions)" />
2022
<PackageReference Include="Microsoft.Extensions.Options" Version="$(PackageVersion_MicrosoftExtensions)" />
2123
<PackageReference Include="YamlDotNet" Version="$(PackageVersion_YamlDotNet)" />
2224
</ItemGroup>
2325

24-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
25-
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
26-
</ItemGroup>
27-
2826
<ItemGroup>
2927
<Compile Remove="VersionConverters\*\AddFormats\**\*.*" />
3028
<Compile Remove="VersionConverters\*\Templates\**\*.*" />

src/GitVersionExe.Tests/GitVersionExe.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
3+
<TargetFrameworks>net48;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
44

55
<IsTestProject>true</IsTestProject>
66
</PropertyGroup>

src/GitVersionExe/GitVersionExe.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<PropertyGroup Condition=" '$(PackAsTool)' != 'true'">
15-
<TargetFrameworks>net472;$(TargetFrameworks);</TargetFrameworks>
15+
<TargetFrameworks>net48;$(TargetFrameworks);</TargetFrameworks>
1616
</PropertyGroup>
1717

1818
<PropertyGroup Condition=" '$(PackAsTool)' == 'true' ">
@@ -21,7 +21,7 @@
2121
<PackageDescription>Derives SemVer information from a repository following GitFlow or GitHubFlow. This is the .NET Core Global Tool allowing usage of GitVersion from command line.</PackageDescription>
2222
</PropertyGroup>
2323

24-
<ItemGroup Condition="'$(TargetFramework)'=='net472'">
24+
<ItemGroup Condition="'$(TargetFramework)'=='net48'">
2525
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" />
2626
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="$(PackageVersion_LibGit2Sharp_NativeBinaries)" />
2727
</ItemGroup>

src/GitVersionTask.MsBuild/GitVersionTask.MsBuild.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net48;netstandard2.0</TargetFrameworks>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
</PropertyGroup>
77

src/GitVersionTask.MsBuild/LibGit2Sharp/LibGit2SharpLoader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using System.Reflection;
66

7-
#if NET472
7+
#if NETFRAMEWORK
88
using System;
99
using System.Collections.Generic;
1010
#endif

src/GitVersionTask.MsBuild/PlatformAbstraction/Native/NativeMethods.Unix.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if NET45
5+
#if NETFRAMEWORK
66

77
using System;
88
using System.Runtime.InteropServices;

src/GitVersionTask.Tests/GitVersionTask.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
3+
<TargetFrameworks>net48;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
44

55
<IsTestProject>true</IsTestProject>
66
</PropertyGroup>

src/GitVersionTask.Tests/Helpers/MsBuildExeFixture.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void CreateTestProject(Action<ProjectCreator> extendProject)
6767
var project = RuntimeFramework.CurrentFramework.Runtime switch
6868
{
6969
RuntimeType.NetCore => ProjectCreator.Templates.SdkCsproj(ProjectPath),
70-
RuntimeType.Net => ProjectCreator.Templates.LegacyCsproj(ProjectPath, defaultTargets: null, targetFrameworkVersion: "v4.7.2", toolsVersion: "15.0"),
70+
RuntimeType.Net => ProjectCreator.Templates.LegacyCsproj(ProjectPath, defaultTargets: null, targetFrameworkVersion: "v4.8", toolsVersion: "15.0"),
7171
_ => null
7272
};
7373

src/GitVersionTask/GitVersionTask.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks>
4+
<TargetFrameworks>net48;netcoreapp2.1</TargetFrameworks>
55

66
<PackageId>GitVersionTask</PackageId>
77
<Title>GitVersionTask</Title>

src/GitVersionTask/build/GitVersionTask.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<GitVersionAssemblyFile Condition="$(GitVersionAssemblyFile) == '' And '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\GitVersionTask.MsBuild.dll</GitVersionAssemblyFile>
4+
<GitVersionAssemblyFile Condition="$(GitVersionAssemblyFile) == '' And '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net48\GitVersionTask.MsBuild.dll</GitVersionAssemblyFile>
55
<GitVersionAssemblyFile Condition="$(GitVersionAssemblyFile) == '' And '$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\netstandard2.0\GitVersionTask.MsBuild.dll</GitVersionAssemblyFile>
66

77
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

src/GitVersionTask/nuget-files.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<FullPublishTask>bin/$(Configuration)/net472</FullPublishTask>
4+
<FullPublishTask>bin/$(Configuration)/net48</FullPublishTask>
55
<CorePublishTask>bin/$(Configuration)/netcoreapp2.1/publish</CorePublishTask>
6-
<FullTarget>tools/net472</FullTarget>
6+
<FullTarget>tools/net48</FullTarget>
77
<CoreTarget>tools/netstandard2.0</CoreTarget>
88
</PropertyGroup>
99
<ItemGroup>

tests/integration/full/app.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{C1765652-F8AE-4FFD-AFC8-72054A5A91B7}</ProjectGuid>
8-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
8+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
99
<FileAlignment>512</FileAlignment>
1010
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1111
<Deterministic>true</Deterministic>
@@ -14,15 +14,15 @@
1414
<PlatformTarget>AnyCPU</PlatformTarget>
1515
<DebugSymbols>true</DebugSymbols>
1616
<DebugType>full</DebugType>
17-
<Optimize>false</Optimize>
17+
<Optimize>false</Optimize>
1818
<DefineConstants>DEBUG;TRACE</DefineConstants>
1919
<ErrorReport>prompt</ErrorReport>
2020
<WarningLevel>4</WarningLevel>
2121
</PropertyGroup>
2222
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2323
<PlatformTarget>AnyCPU</PlatformTarget>
2424
<DebugType>pdbonly</DebugType>
25-
<Optimize>true</Optimize>
25+
<Optimize>true</Optimize>
2626
<DefineConstants>TRACE</DefineConstants>
2727
<ErrorReport>prompt</ErrorReport>
2828
<WarningLevel>4</WarningLevel>

0 commit comments

Comments
 (0)