Skip to content

Commit e1f1ef9

Browse files
committed
(#2997) net4.8 removal
1 parent d4b9a49 commit e1f1ef9

33 files changed

+12
-237
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
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: [net48, net6.0, netcoreapp3.1]
132+
targetFramework: [net6.0, netcoreapp3.1]
133133
fail-fast: false
134134

135135
steps:

build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,5 @@ 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);
6246
}
6347
}

build/build/Tasks/Test/UnitTest.cs

Lines changed: 2 additions & 7 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, Constants.FullFxVersion48)]
11+
[TaskArgument(Arguments.DotnetTarget, Constants.NetVersion60, Constants.CoreFxVersion31)]
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.FullFxVersion48, Constants.NetVersion60 };
20+
var frameworks = new[] { Constants.CoreFxVersion31, Constants.NetVersion60 };
2121
if (!string.IsNullOrWhiteSpace(dotnetTarget))
2222
{
2323
if (!frameworks.Contains(dotnetTarget, StringComparer.OrdinalIgnoreCase))
@@ -87,11 +87,6 @@ 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-
9590
context.DotNetTest(project.FullPath, settings, coverletSettings);
9691
}
9792
}

build/common/Utilities/Constants.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ public class Constants
1010

1111
public const string NetVersion60 = "net6.0";
1212
public const string CoreFxVersion31 = "netcoreapp3.1";
13-
public const string FullFxVersion48 = "net48";
14-
15-
public const string NoMono = "NoMono";
16-
public const string NoNet48 = "NoNet48";
1713

1814
public static readonly string[] VersionsToBuild = { Version60, Version31 };
1915
public static readonly Architecture[] ArchToBuild = { Architecture.Amd64, Architecture.Arm64 };

src/Directory.Build.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@
8383
<None Include="../../build/nuspec/README.md" Pack="true" PackagePath="/"/>
8484
</ItemGroup>
8585

86-
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
87-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
88-
</ItemGroup>
89-
9086
<!-- Workaround to enable .editorconfig based analyzer configuration until dotnet compilers support .editorconfig based configuration -->
9187
<PropertyGroup>
9288
<SkipDefaultEditorConfigAsAdditionalFile>true</SkipDefaultEditorConfigAsAdditionalFile>

src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void WorkingDirectoryWithoutCommitsFailsWithInformativeMessage()
7373
public void WorkingDirectoryDoesNotExistFailsWithInformativeMessage()
7474
{
7575
var workingDirectory = PathHelper.Combine(ExecutableHelper.GetCurrentDirectory(), Guid.NewGuid().ToString("N"));
76-
var executable = ExecutableHelper.GetExecutable();
76+
var executable = ExecutableHelper.GetDotNetExecutable();
7777

7878
var output = new StringBuilder();
7979
var args = ExecutableHelper.GetExecutableArgs($" /targetpath {workingDirectory} ");

src/GitVersion.App.Tests/GitVersion.App.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net48;netcoreapp3.1;net6.0</TargetFrameworks>
3+
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
44

55
<IsTestProject>true</IsTestProject>
66
</PropertyGroup>
@@ -21,7 +21,6 @@
2121
<ItemGroup>
2222
<Compile Include="..\GitVersion.Core.Tests\Helpers\DirectoryHelper.cs" Link="Helpers\DirectoryHelper.cs" />
2323
<Compile Include="..\GitVersion.Core.Tests\Helpers\ExecutableHelper.cs" Link="Helpers\ExecutableHelper.cs" />
24-
<Compile Include="..\GitVersion.Core.Tests\Helpers\RuntimeHelper.cs" Link="Helpers\RuntimeHelper.cs" />
2524
<Compile Include="..\GitVersion.Core.Tests\Helpers\TestEffectiveConfiguration.cs" Link="Helpers\TestEffectiveConfiguration.cs" />
2625
<Compile Include="..\GitVersion.Core.Tests\Helpers\TestEnvironment.cs" Link="Helpers\TestEnvironment.cs" />
2726
<Compile Include="..\GitVersion.Core.Tests\Helpers\TestFileSystem.cs" Link="Helpers\TestFileSystem.cs" />

src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments,
3636
params KeyValuePair<string, string?>[] environments
3737
)
3838
{
39-
var executable = ExecutableHelper.GetExecutable();
39+
var executable = ExecutableHelper.GetDotNetExecutable();
4040
var output = new StringBuilder();
4141

4242
var environmentalVariables = new Dictionary<string, string?>

src/GitVersion.App/GitVersion.App.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1010
</PropertyGroup>
1111

12-
<PropertyGroup Condition=" '$(PackAsTool)' != 'true'">
13-
<TargetFrameworks>net48;$(TargetFrameworks);</TargetFrameworks>
14-
</PropertyGroup>
15-
1612
<!-- workaround for https://github.com/dotnet/runtime/issues/49508 -->
1713
<PropertyGroup Condition=" '$(OsxArm64)' == 'true'">
1814
<TargetFrameworks>net6.0</TargetFrameworks>
@@ -25,11 +21,6 @@
2521
<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>
2622
</PropertyGroup>
2723

28-
<ItemGroup Condition="'$(TargetFramework)'=='net48'">
29-
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" />
30-
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="$(PackageVersion_LibGit2Sharp_NativeBinaries)" />
31-
</ItemGroup>
32-
3324
<ItemGroup>
3425
<PackageReference Include="System.Text.Json" Version="$(PackageVersion_MicrosoftJson)" />
3526
<PackageReference Include="System.Text.Encodings.Web" Version="$(PackageVersion_MicrosoftJson)" />

src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ public void NextVersionCanHavePatch()
228228

229229
[Test]
230230
[MethodImpl(MethodImplOptions.NoInlining)]
231-
[Category(NoMono)]
232-
[Description(NoMonoDescription)]
233231
public void CanWriteOutEffectiveConfiguration()
234232
{
235233
var config = this.configProvider.Provide(this.repoPath);

src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public class InitScenarios : TestBase
1717
public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute<TestAttribute>();
1818

1919
[Test]
20-
[Category(NoMono)]
21-
[Description(NoMonoDescription)]
2220
public void CanSetNextVersion()
2321
{
2422
var workingDirectory = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "c:\\proj" : "/proj";

src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized()
7373
}
7474

7575
[Test]
76-
[Category(NoMono)]
77-
[Description(NoMonoDescription)]
7876
public void CacheKeyForWorktree()
7977
{
8078
using var fixture = new EmptyRepositoryFixture();
@@ -411,8 +409,6 @@ public void WorkingDirectoryWithoutCommits()
411409
}
412410

413411
[Test]
414-
[Category(NoMono)]
415-
[Description(NoMonoDescription)]
416412
public void GetProjectRootDirectoryWorkingDirectoryWithWorktree()
417413
{
418414
using var fixture = new EmptyRepositoryFixture();
@@ -480,8 +476,6 @@ public void GetDotGitDirectoryNoWorktree()
480476
}
481477

482478
[Test]
483-
[Category(NoMono)]
484-
[Description(NoMonoDescription)]
485479
public void GetDotGitDirectoryWorktree()
486480
{
487481
using var fixture = new EmptyRepositoryFixture();
@@ -512,8 +506,6 @@ public void GetDotGitDirectoryWorktree()
512506
}
513507

514508
[Test]
515-
[Category(NoMono)]
516-
[Description(NoMonoDescription)]
517509
public void CalculateVersionFromWorktreeHead()
518510
{
519511
// Setup
@@ -543,8 +535,6 @@ public void CalculateVersionFromWorktreeHead()
543535
}
544536

545537
[Test]
546-
[Category(NoMono)]
547-
[Description(NoMonoDescription)]
548538
public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTagged_ThrowException()
549539
{
550540
// Setup
@@ -571,8 +561,6 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTa
571561
}
572562

573563
[Test]
574-
[Category(NoMono)]
575-
[Description(NoMonoDescription)]
576564
public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndTagged_ReturnSemver()
577565
{
578566
// Setup

src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net48;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
55

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

src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ public static class ExecutableHelper
66
{
77
public static string GetCurrentDirectory() => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException();
88

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

1111
public static string GetExecutableArgs(string args)
1212
{
13-
if (RuntimeHelper.IsCoreClr())
14-
{
15-
args = $"{PathHelper.Combine(GetExeDirectory(), "gitversion.dll")} {args}";
16-
}
13+
args = $"{PathHelper.Combine(GetExeDirectory(), "gitversion.dll")} {args}";
1714
return args;
1815
}
1916

src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/GitVersion.Core.Tests/Helpers/TestBase.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ namespace GitVersion.Core.Tests.Helpers;
88

99
public class TestBase
1010
{
11-
protected const string NoMonoDescription = "Won't run on Mono due to source information not being available for ShouldMatchApproved.";
12-
protected const string NoMono = "NoMono";
13-
protected const string NoNet48 = "NoNet48";
1411
public const string MainBranch = "main";
1512

1613
protected static IServiceProvider ConfigureServices(Action<IServiceCollection>? overrideServices = null)

src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ namespace GitVersion.Core.Tests.IntegrationTests;
1010
[TestFixture]
1111
public class WorktreeScenarios : TestBase
1212
{
13-
1413
[Test]
15-
[Category(NoMono)]
16-
[Description(NoMonoDescription)]
1714
public void UseWorktreeRepositoryForVersion()
1815
{
1916
using var fixture = new EmptyRepositoryFixture();

src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public class JsonVersionBuilderTests : TestBase
1313
public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute<TestAttribute>();
1414

1515
[Test]
16-
[Category(NoMono)]
17-
[Description(NoMonoDescription)]
1816
public void Json()
1917
{
2018
var semanticVersion = new SemanticVersion

src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public void ShouldLogWarningWhenUsingDefaultInformationalVersionInCustomFormat()
4848
}
4949

5050
[Test]
51-
[Category(NoMono)]
52-
[Description(NoMonoDescription)]
5351
public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
5452
{
5553
var semVer = new SemanticVersion
@@ -75,8 +73,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreRelease()
7573
}
7674

7775
[Test]
78-
[Category(NoMono)]
79-
[Description(NoMonoDescription)]
8076
public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
8177
{
8278
var semVer = new SemanticVersion
@@ -102,8 +98,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding()
10298
}
10399

104100
[Test]
105-
[Category(NoMono)]
106-
[Description(NoMonoDescription)]
107101
public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
108102
{
109103
var semVer = new SemanticVersion
@@ -128,8 +122,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForPreRelease()
128122
}
129123

130124
[Test]
131-
[Category(NoMono)]
132-
[Description(NoMonoDescription)]
133125
public void ProvidesVariablesInContinuousDeliveryModeForStable()
134126
{
135127
var semVer = new SemanticVersion
@@ -153,8 +145,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable()
153145
}
154146

155147
[Test]
156-
[Category(NoMono)]
157-
[Description(NoMonoDescription)]
158148
public void ProvidesVariablesInContinuousDeploymentModeForStable()
159149
{
160150
var semVer = new SemanticVersion
@@ -178,8 +168,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForStable()
178168
}
179169

180170
[Test]
181-
[Category(NoMono)]
182-
[Description(NoMonoDescription)]
183171
public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged()
184172
{
185173
var semVer = new SemanticVersion
@@ -251,8 +239,6 @@ public void ProvidesVariablesInContinuousDeploymentModeWithTagSetToUseBranchName
251239
}
252240

253241
[Test]
254-
[Category(NoMono)]
255-
[Description(NoMonoDescription)]
256242
public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch()
257243
{
258244
var semVer = new SemanticVersion
@@ -278,8 +264,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch()
278264
}
279265

280266
[Test]
281-
[Category(NoMono)]
282-
[Description(NoMonoDescription)]
283267
public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat()
284268
{
285269
var semVer = new SemanticVersion

0 commit comments

Comments
 (0)