Skip to content

Commit

Permalink
GH-2095 - Target .net48 instead of .net472
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Jun 29, 2020
1 parent b22e872 commit 0976842
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion build/pack.cake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Task("Pack-Prepare")
{
PackPrepareNative(Context, parameters);
var frameworks = new[] { parameters.CoreFxVersion21, parameters.FullFxVersion472 };
var frameworks = new[] { parameters.CoreFxVersion21, parameters.FullFxVersion48 };
// MsBuild Task
foreach(var framework in frameworks)
Expand Down
4 changes: 2 additions & 2 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.FullFxVersion472 };
var frameworks = new[] { parameters.CoreFxVersion31, parameters.FullFxVersion48 };
var testResultsPath = parameters.Paths.Directories.TestResultsOutput;
foreach(var framework in frameworks)
Expand Down Expand Up @@ -39,7 +39,7 @@ Task("UnitTest")
Exclude = new List<string> { "[GitVersion*.Tests]*", "[GitVersionTask.MsBuild]*" }
};
if (IsRunningOnUnix() && string.Equals(framework, parameters.FullFxVersion472))
if (IsRunningOnUnix() && string.Equals(framework, parameters.FullFxVersion48))
{
settings.Filter = "TestCategory!=NoMono";
}
Expand Down
2 changes: 1 addition & 1 deletion build/utils/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BuildParameters
public const string MainRepoName = "GitVersion";
public string CoreFxVersion21 { get; private set; } = "netcoreapp2.1";
public string CoreFxVersion31 { get; private set; } = "netcoreapp3.1";
public string FullFxVersion472 { get; private set; } = "net472";
public string FullFxVersion48 { get; private set; } = "net48";

public string DockerDistro { get; private set; }
public string DockerDotnetVersion { get; private set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</None>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/Docker/Readme.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# There are 4 variants of docker image

- based on **microsoft/dotnet-framework:4.7.2-runtime** - Windows Full FX
- based on **microsoft/dotnet-framework:4.8-runtime** - Windows Full FX
- based on **microsoft/dotnet:2.1-runtime** - Windows dotnet core
- based on **mono:5.18** - Linux Full FX - on mono
- based on **microsoft/dotnet:2.1-runtime** - Linux dotnet core
- based on **centos:7** - linux dotnet core

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

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

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

`docker run --rm -v "$(pwd):/repo" gittools/gitversion:latest-linux-netcoreapp2.1 /repo`
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>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>

<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand Down
6 changes: 2 additions & 4 deletions src/GitVersionCore/GitVersionCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Net.Requests" Version="4.3.0" />

<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)" />
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="YamlDotNet" Version="$(PackageVersion_YamlDotNet)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<Compile Remove="VersionConverters\*\AddFormats\**\*.*" />
<Compile Remove="VersionConverters\*\Templates\**\*.*" />
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>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/GitVersionExe/GitVersionExe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<PropertyGroup Condition=" '$(PackAsTool)' != 'true'">
<TargetFrameworks>net472;$(TargetFrameworks);</TargetFrameworks>
<TargetFrameworks>net48;$(TargetFrameworks);</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(PackAsTool)' == 'true' ">
Expand All @@ -21,7 +21,7 @@
<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>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net472'">
<ItemGroup Condition="'$(TargetFramework)'=='net48'">
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="$(PackageVersion_LibGit2Sharp_NativeBinaries)" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask.MsBuild/GitVersionTask.MsBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net48;netstandard2.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using System.Reflection;

#if NET472
#if NETFRAMEWORK
using System;
using System.Collections.Generic;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if NET45
#if NETFRAMEWORK

using System;
using System.Runtime.InteropServices;
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask.Tests/GitVersionTask.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask.Tests/Helpers/MsBuildExeFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void CreateTestProject(Action<ProjectCreator> extendProject)
var project = RuntimeFramework.CurrentFramework.Runtime switch
{
RuntimeType.NetCore => ProjectCreator.Templates.SdkCsproj(ProjectPath),
RuntimeType.Net => ProjectCreator.Templates.LegacyCsproj(ProjectPath, defaultTargets: null, targetFrameworkVersion: "v4.7.2", toolsVersion: "15.0"),
RuntimeType.Net => ProjectCreator.Templates.LegacyCsproj(ProjectPath, defaultTargets: null, targetFrameworkVersion: "v4.8", toolsVersion: "15.0"),
_ => null
};

Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask/GitVersionTask.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp2.1</TargetFrameworks>

<PackageId>GitVersionTask</PackageId>
<Title>GitVersionTask</Title>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionTask/build/GitVersionTask.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GitVersionAssemblyFile Condition="$(GitVersionAssemblyFile) == '' And '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\GitVersionTask.MsBuild.dll</GitVersionAssemblyFile>
<GitVersionAssemblyFile Condition="$(GitVersionAssemblyFile) == '' And '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net48\GitVersionTask.MsBuild.dll</GitVersionAssemblyFile>
<GitVersionAssemblyFile Condition="$(GitVersionAssemblyFile) == '' And '$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\netstandard2.0\GitVersionTask.MsBuild.dll</GitVersionAssemblyFile>

<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
Expand Down
4 changes: 2 additions & 2 deletions src/GitVersionTask/nuget-files.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<FullPublishTask>bin/$(Configuration)/net472</FullPublishTask>
<FullPublishTask>bin/$(Configuration)/net48</FullPublishTask>
<CorePublishTask>bin/$(Configuration)/netcoreapp2.1/publish</CorePublishTask>
<FullTarget>tools/net472</FullTarget>
<FullTarget>tools/net48</FullTarget>
<CoreTarget>tools/netstandard2.0</CoreTarget>
</PropertyGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/full/app.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C1765652-F8AE-4FFD-AFC8-72054A5A91B7}</ProjectGuid>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
Expand All @@ -14,15 +14,15 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down

0 comments on commit 0976842

Please sign in to comment.