Skip to content

Commit d53fdb7

Browse files
committed
(#2997) net4.8 removal
1 parent 35f28bd commit d53fdb7

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
@@ -81,10 +81,6 @@
8181
<None Include="../../build/nuspec/README.md" Pack="true" PackagePath="/"/>
8282
</ItemGroup>
8383

84-
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
85-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
86-
</ItemGroup>
87-
8884
<!-- Workaround to enable .editorconfig based analyzer configuration until dotnet compilers support .editorconfig based configuration -->
8985
<PropertyGroup>
9086
<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 = Path.Combine(PathHelper.GetCurrentDirectory(), Guid.NewGuid().ToString("N"));
76-
var executable = PathHelper.GetExecutable();
76+
var executable = PathHelper.GetDotNetExecutable();
7777

7878
var output = new StringBuilder();
7979
var args = PathHelper.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\PathHelper.cs" Link="Helpers\PathHelper.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 = PathHelper.GetExecutable();
39+
var executable = PathHelper.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
@@ -10,10 +10,6 @@
1010
<DocumentationFile>bin\$(Configuration)\GitVersion.xml</DocumentationFile>
1111
</PropertyGroup>
1212

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

29-
<ItemGroup Condition="'$(TargetFramework)'=='net48'">
30-
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" />
31-
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="$(PackageVersion_LibGit2Sharp_NativeBinaries)" />
32-
</ItemGroup>
33-
3425
<ItemGroup>
3526
<PackageReference Include="System.Text.Json" Version="$(PackageVersion_MicrosoftJson)" />
3627
<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
@@ -226,8 +226,6 @@ public void NextVersionCanHavePatch()
226226

227227
[Test]
228228
[MethodImpl(MethodImplOptions.NoInlining)]
229-
[Category(NoMono)]
230-
[Description(NoMonoDescription)]
231229
public void CanWriteOutEffectiveConfiguration()
232230
{
233231
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
@@ -16,8 +16,6 @@ public class InitScenarios : TestBase
1616
public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute<TestAttribute>();
1717

1818
[Test]
19-
[Category(NoMono)]
20-
[Description(NoMonoDescription)]
2119
public void CanSetNextVersion()
2220
{
2321
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
@@ -72,8 +72,6 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized()
7272
}
7373

7474
[Test]
75-
[Category(NoMono)]
76-
[Description(NoMonoDescription)]
7775
public void CacheKeyForWorktree()
7876
{
7977
using var fixture = new EmptyRepositoryFixture();
@@ -410,8 +408,6 @@ public void WorkingDirectoryWithoutCommits()
410408
}
411409

412410
[Test]
413-
[Category(NoMono)]
414-
[Description(NoMonoDescription)]
415411
public void GetProjectRootDirectoryWorkingDirectoryWithWorktree()
416412
{
417413
using var fixture = new EmptyRepositoryFixture();
@@ -479,8 +475,6 @@ public void GetDotGitDirectoryNoWorktree()
479475
}
480476

481477
[Test]
482-
[Category(NoMono)]
483-
[Description(NoMonoDescription)]
484478
public void GetDotGitDirectoryWorktree()
485479
{
486480
using var fixture = new EmptyRepositoryFixture();
@@ -511,8 +505,6 @@ public void GetDotGitDirectoryWorktree()
511505
}
512506

513507
[Test]
514-
[Category(NoMono)]
515-
[Description(NoMonoDescription)]
516508
public void CalculateVersionFromWorktreeHead()
517509
{
518510
// Setup
@@ -542,8 +534,6 @@ public void CalculateVersionFromWorktreeHead()
542534
}
543535

544536
[Test]
545-
[Category(NoMono)]
546-
[Description(NoMonoDescription)]
547537
public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTagged_ThrowException()
548538
{
549539
// Setup
@@ -573,8 +563,6 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTa
573563
}
574564

575565
[Test]
576-
[Category(NoMono)]
577-
[Description(NoMonoDescription)]
578566
public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndTagged_ReturnSemver()
579567
{
580568
// 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/PathHelper.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ public static class PathHelper
44
{
55
public static string GetCurrentDirectory() => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
66

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

99
public static string GetExecutableArgs(string args)
1010
{
11-
if (RuntimeHelper.IsCoreClr())
12-
{
13-
args = $"{Path.Combine(GetExeDirectory(), "gitversion.dll")} {args}";
14-
}
11+
args = $"{Path.Combine(GetExeDirectory(), "gitversion.dll")} {args}";
1512
return args;
1613
}
1714

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
@@ -8,10 +8,7 @@ namespace GitVersion.Core.Tests.IntegrationTests;
88
[TestFixture]
99
public class WorktreeScenarios : TestBase
1010
{
11-
1211
[Test]
13-
[Category(NoMono)]
14-
[Description(NoMonoDescription)]
1512
public void UseWorktreeRepositoryForVersion()
1613
{
1714
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)