Skip to content

Commit

Permalink
(#2997) net4.8 removal
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Mar 10, 2022
1 parent 7b0e243 commit 5c9e137
Show file tree
Hide file tree
Showing 33 changed files with 12 additions and 237 deletions.
2 changes: 1 addition & 1 deletion .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, net6.0, netcoreapp3.1]
targetFramework: [net6.0, netcoreapp3.1]
fail-fast: false

steps:
Expand Down
16 changes: 0 additions & 16 deletions build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,5 @@ public override void Run(BuildContext context)
var netcoreExe = Paths.Integration.Combine("core").Combine("build").Combine(framework).CombineWithFilePath("app.dll");
context.ValidateOutput("dotnet", netcoreExe.FullPath, context.Version.GitVersion.FullSemVer);
}

context.Information("\nTesting msbuild task with msbuild (for full framework)\n");

var msBuildSettings = new MSBuildSettings
{
Verbosity = Verbosity.Minimal,
Restore = true
};

msBuildSettings.WithProperty("GitVersionMsBuildVersion", version);
msBuildSettings.WithProperty("RestoreSource", nugetSource);

context.MSBuild("./tests/integration/full", msBuildSettings);

var fullExe = Paths.Integration.Combine("full").Combine("build").CombineWithFilePath("app.exe");
context.ValidateOutput(fullExe.FullPath, null, context.Version.GitVersion.FullSemVer);
}
}
9 changes: 2 additions & 7 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.NetVersion60, Constants.CoreFxVersion31, Constants.FullFxVersion48)]
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion60, Constants.CoreFxVersion31)]
[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.NetVersion60 };
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion60 };
if (!string.IsNullOrWhiteSpace(dotnetTarget))
{
if (!frameworks.Contains(dotnetTarget, StringComparer.OrdinalIgnoreCase))
Expand Down Expand Up @@ -87,11 +87,6 @@ private static void TestProjectForTarget(BuildContext context, FilePath project,
Exclude = new List<string> { "[GitVersion*.Tests]*", "[GitTools.Testing]*" }
};

if (string.Equals(framework, Constants.FullFxVersion48))
{
settings.Filter = context.IsRunningOnUnix() ? $"TestCategory!={Constants.NoMono}" : $"TestCategory!={Constants.NoNet48}";
}

context.DotNetTest(project.FullPath, settings, coverletSettings);
}
}
4 changes: 0 additions & 4 deletions build/common/Utilities/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ public class Constants

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, Version31 };
public static readonly Architecture[] ArchToBuild = { Architecture.Amd64, Architecture.Arm64 };
Expand Down
4 changes: 0 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@
<None Include="../../build/nuspec/README.md" Pack="true" PackagePath="/"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
</ItemGroup>

<!-- Workaround to enable .editorconfig based analyzer configuration until dotnet compilers support .editorconfig based configuration -->
<PropertyGroup>
<SkipDefaultEditorConfigAsAdditionalFile>true</SkipDefaultEditorConfigAsAdditionalFile>
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void WorkingDirectoryWithoutCommitsFailsWithInformativeMessage()
public void WorkingDirectoryDoesNotExistFailsWithInformativeMessage()
{
var workingDirectory = PathHelper.Combine(ExecutableHelper.GetCurrentDirectory(), Guid.NewGuid().ToString("N"));
var executable = ExecutableHelper.GetExecutable();
var executable = ExecutableHelper.GetDotNetExecutable();

var output = new StringBuilder();
var args = ExecutableHelper.GetExecutableArgs($" /targetpath {workingDirectory} ");
Expand Down
3 changes: 1 addition & 2 deletions 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;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>

<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand All @@ -21,7 +21,6 @@
<ItemGroup>
<Compile Include="..\GitVersion.Core.Tests\Helpers\DirectoryHelper.cs" Link="Helpers\DirectoryHelper.cs" />
<Compile Include="..\GitVersion.Core.Tests\Helpers\ExecutableHelper.cs" Link="Helpers\ExecutableHelper.cs" />
<Compile Include="..\GitVersion.Core.Tests\Helpers\RuntimeHelper.cs" Link="Helpers\RuntimeHelper.cs" />
<Compile Include="..\GitVersion.Core.Tests\Helpers\TestEffectiveConfiguration.cs" Link="Helpers\TestEffectiveConfiguration.cs" />
<Compile Include="..\GitVersion.Core.Tests\Helpers\TestEnvironment.cs" Link="Helpers\TestEnvironment.cs" />
<Compile Include="..\GitVersion.Core.Tests\Helpers\TestFileSystem.cs" Link="Helpers\TestFileSystem.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments,
params KeyValuePair<string, string?>[] environments
)
{
var executable = ExecutableHelper.GetExecutable();
var executable = ExecutableHelper.GetDotNetExecutable();
var output = new StringBuilder();

var environmentalVariables = new Dictionary<string, string?>
Expand Down
9 changes: 0 additions & 9 deletions src/GitVersion.App/GitVersion.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

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

<!-- workaround for https://github.com/dotnet/runtime/issues/49508 -->
<PropertyGroup Condition=" '$(OsxArm64)' == 'true'">
<TargetFrameworks>net6.0</TargetFrameworks>
Expand All @@ -25,11 +21,6 @@
<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)'=='net48'">
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="$(PackageVersion_LibGit2Sharp_NativeBinaries)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="$(PackageVersion_MicrosoftJson)" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(PackageVersion_MicrosoftJson)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ public void NextVersionCanHavePatch()

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void CanWriteOutEffectiveConfiguration()
{
var config = this.configProvider.Provide(this.repoPath);
Expand Down
2 changes: 0 additions & 2 deletions src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public class InitScenarios : TestBase
public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute<TestAttribute>();

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void CanSetNextVersion()
{
var workingDirectory = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "c:\\proj" : "/proj";
Expand Down
12 changes: 0 additions & 12 deletions src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void CacheKeyForWorktree()
{
using var fixture = new EmptyRepositoryFixture();
Expand Down Expand Up @@ -411,8 +409,6 @@ public void WorkingDirectoryWithoutCommits()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void GetProjectRootDirectoryWorkingDirectoryWithWorktree()
{
using var fixture = new EmptyRepositoryFixture();
Expand Down Expand Up @@ -480,8 +476,6 @@ public void GetDotGitDirectoryNoWorktree()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void GetDotGitDirectoryWorktree()
{
using var fixture = new EmptyRepositoryFixture();
Expand Down Expand Up @@ -512,8 +506,6 @@ public void GetDotGitDirectoryWorktree()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void CalculateVersionFromWorktreeHead()
{
// Setup
Expand Down Expand Up @@ -543,8 +535,6 @@ public void CalculateVersionFromWorktreeHead()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTagged_ThrowException()
{
// Setup
Expand All @@ -571,8 +561,6 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTa
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndTagged_ReturnSemver()
{
// Setup
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;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>

<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand Down
7 changes: 2 additions & 5 deletions src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ public static class ExecutableHelper
{
public static string GetCurrentDirectory() => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException();

public static string GetExecutable() => RuntimeHelper.IsCoreClr() ? "dotnet" : PathHelper.Combine(GetExeDirectory(), "gitversion.exe");
public static string GetDotNetExecutable() => "dotnet";

public static string GetExecutableArgs(string args)
{
if (RuntimeHelper.IsCoreClr())
{
args = $"{PathHelper.Combine(GetExeDirectory(), "gitversion.dll")} {args}";
}
args = $"{PathHelper.Combine(GetExeDirectory(), "gitversion.dll")} {args}";
return args;
}

Expand Down
21 changes: 0 additions & 21 deletions src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs

This file was deleted.

3 changes: 0 additions & 3 deletions src/GitVersion.Core.Tests/Helpers/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ namespace GitVersion.Core.Tests.Helpers;

public class TestBase
{
protected const string NoMonoDescription = "Won't run on Mono due to source information not being available for ShouldMatchApproved.";
protected const string NoMono = "NoMono";
protected const string NoNet48 = "NoNet48";
public const string MainBranch = "main";

protected static IServiceProvider ConfigureServices(Action<IServiceCollection>? overrideServices = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ namespace GitVersion.Core.Tests.IntegrationTests;
[TestFixture]
public class WorktreeScenarios : TestBase
{

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void UseWorktreeRepositoryForVersion()
{
using var fixture = new EmptyRepositoryFixture();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public class JsonVersionBuilderTests : TestBase
public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute<TestAttribute>();

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void Json()
{
var semanticVersion = new SemanticVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public void ShouldLogWarningWhenUsingDefaultInformationalVersionInCustomFormat()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
{
var semVer = new SemanticVersion
Expand All @@ -75,8 +73,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
{
var semVer = new SemanticVersion
Expand All @@ -102,8 +98,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
{
var semVer = new SemanticVersion
Expand All @@ -128,8 +122,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeliveryModeForStable()
{
var semVer = new SemanticVersion
Expand All @@ -153,8 +145,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeploymentModeForStable()
{
var semVer = new SemanticVersion
Expand All @@ -178,8 +168,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForStable()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged()
{
var semVer = new SemanticVersion
Expand Down Expand Up @@ -251,8 +239,6 @@ public void ProvidesVariablesInContinuousDeploymentModeWithTagSetToUseBranchName
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch()
{
var semVer = new SemanticVersion
Expand All @@ -278,8 +264,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch()
}

[Test]
[Category(NoMono)]
[Description(NoMonoDescription)]
public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat()
{
var semVer = new SemanticVersion
Expand Down
Loading

0 comments on commit 5c9e137

Please sign in to comment.