From 3fe7c808493efa8f38d58fad1bfc2190c7beeaaa Mon Sep 17 00:00:00 2001 From: Artur Date: Sun, 6 Mar 2022 13:59:51 +0100 Subject: [PATCH] (#2997) net4.8 removal --- .github/workflows/ci.yml | 2 +- .../Tasks/ArtifactsMsBuildFullTest.cs | 16 ------- build/build/Tasks/Test/UnitTest.cs | 9 +--- build/common/Utilities/Constants.cs | 4 -- src/Directory.Build.props | 4 -- .../ExecCmdLineArgumentTest.cs | 2 +- .../GitVersion.App.Tests.csproj | 3 +- .../Helpers/GitVersionHelper.cs | 2 +- src/GitVersion.App/GitVersion.App.csproj | 9 ---- .../Configuration/ConfigProviderTests.cs | 2 - .../Configuration/Init/InitScenarios.cs | 2 - .../Core/GitVersionExecutorTests.cs | 12 ------ .../GitVersion.Core.Tests.csproj | 2 +- .../Helpers/ExecutableHelper.cs | 7 +--- .../Helpers/RuntimeHelper.cs | 21 ---------- src/GitVersion.Core.Tests/Helpers/TestBase.cs | 3 -- .../IntegrationTests/WorktreeScenarios.cs | 3 -- .../JsonVersionBuilderTests.cs | 2 - .../VariableProviderTests.cs | 16 ------- .../AssemblyInfoFileUpdaterTests.cs | 14 ------- .../GitVersionInfoGeneratorTests.cs | 2 - .../ProjectFileUpdaterTests.cs | 20 --------- .../VersionConverters/WixFileTests.cs | 4 -- .../GitVersion.MsBuild.Tests.csproj | 5 +-- .../Helpers/MsBuildExeFixture.cs | 11 +---- .../Helpers/MsBuildTaskFixture.cs | 5 --- .../GenerateGitVersionInformationTest.cs | 4 -- .../Tasks/GetVersionTaskTests.cs | 4 -- .../Tasks/UpdateAssemblyInfoTaskTest.cs | 4 -- .../Tasks/WriteVersionInfoTest.cs | 4 -- .../msbuild/tools/GitVersion.MsBuild.props | 5 --- src/GitVersion.MsBuild/nuget-files.props | 4 -- tests/integration/full/app.csproj | 42 ------------------- 33 files changed, 12 insertions(+), 237 deletions(-) delete mode 100644 src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs delete mode 100644 tests/integration/full/app.csproj diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31601803bd..cd1b43ed94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs b/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs index d8a875d91a..006c3a159c 100644 --- a/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs +++ b/build/artifacts/Tasks/ArtifactsMsBuildFullTest.cs @@ -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); } } diff --git a/build/build/Tasks/Test/UnitTest.cs b/build/build/Tasks/Test/UnitTest.cs index 67b089e4c2..511fad62f3 100644 --- a/build/build/Tasks/Test/UnitTest.cs +++ b/build/build/Tasks/Test/UnitTest.cs @@ -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 { @@ -17,7 +17,7 @@ public class UnitTest : FrostingTask 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)) @@ -87,11 +87,6 @@ private static void TestProjectForTarget(BuildContext context, FilePath project, Exclude = new List { "[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); } } diff --git a/build/common/Utilities/Constants.cs b/build/common/Utilities/Constants.cs index bff8009b09..571ee779e9 100644 --- a/build/common/Utilities/Constants.cs +++ b/build/common/Utilities/Constants.cs @@ -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 }; diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 6bce4c3629..32418f6cb2 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -83,10 +83,6 @@ - - - - true diff --git a/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs b/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs index e5cc3906ef..044faad418 100644 --- a/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs +++ b/src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs @@ -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} "); diff --git a/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj b/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj index 9b89c63b47..d0c9895f97 100644 --- a/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj +++ b/src/GitVersion.App.Tests/GitVersion.App.Tests.csproj @@ -1,6 +1,6 @@ - net48;netcoreapp3.1;net6.0 + netcoreapp3.1;net6.0 true @@ -21,7 +21,6 @@ - diff --git a/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs b/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs index a06dc99b2c..c3abbfab25 100644 --- a/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs +++ b/src/GitVersion.App.Tests/Helpers/GitVersionHelper.cs @@ -36,7 +36,7 @@ private static ExecutionResults ExecuteIn(ArgumentBuilder arguments, params KeyValuePair[] environments ) { - var executable = ExecutableHelper.GetExecutable(); + var executable = ExecutableHelper.GetDotNetExecutable(); var output = new StringBuilder(); var environmentalVariables = new Dictionary diff --git a/src/GitVersion.App/GitVersion.App.csproj b/src/GitVersion.App/GitVersion.App.csproj index cf661d97ce..e45c23fa81 100644 --- a/src/GitVersion.App/GitVersion.App.csproj +++ b/src/GitVersion.App/GitVersion.App.csproj @@ -9,10 +9,6 @@ MIT - - net48;$(TargetFrameworks); - - net6.0 @@ -25,11 +21,6 @@ Derives SemVer information from a repository following GitFlow or GitHubFlow. This is the .NET Core Global Tool allowing usage of GitVersion from command line. - - - - - diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs index 82cd710c25..1b1de22c32 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs +++ b/src/GitVersion.Core.Tests/Configuration/ConfigProviderTests.cs @@ -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); diff --git a/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs b/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs index cdef91bd81..9bf8eef45b 100644 --- a/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs +++ b/src/GitVersion.Core.Tests/Configuration/Init/InitScenarios.cs @@ -17,8 +17,6 @@ public class InitScenarios : TestBase public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CanSetNextVersion() { var workingDirectory = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "c:\\proj" : "/proj"; diff --git a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs index 8655937572..9b11fdf967 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs @@ -73,8 +73,6 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CacheKeyForWorktree() { using var fixture = new EmptyRepositoryFixture(); @@ -411,8 +409,6 @@ public void WorkingDirectoryWithoutCommits() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void GetProjectRootDirectoryWorkingDirectoryWithWorktree() { using var fixture = new EmptyRepositoryFixture(); @@ -480,8 +476,6 @@ public void GetDotGitDirectoryNoWorktree() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void GetDotGitDirectoryWorktree() { using var fixture = new EmptyRepositoryFixture(); @@ -512,8 +506,6 @@ public void GetDotGitDirectoryWorktree() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CalculateVersionFromWorktreeHead() { // Setup @@ -543,8 +535,6 @@ public void CalculateVersionFromWorktreeHead() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTagged_ThrowException() { // Setup @@ -571,8 +561,6 @@ public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndNotTa } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CalculateVersionVariables_TwoBranchHasSameCommitHeadDetachedAndTagged_ReturnSemver() { // Setup diff --git a/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj b/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj index 80c758be6e..3de50c8baf 100644 --- a/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj +++ b/src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj @@ -1,7 +1,7 @@ - net48;netcoreapp3.1;net6.0 + netcoreapp3.1;net6.0 full false diff --git a/src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs b/src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs index eae4da3a5e..f5e1b9a8c7 100644 --- a/src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs +++ b/src/GitVersion.Core.Tests/Helpers/ExecutableHelper.cs @@ -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; } diff --git a/src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs b/src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs deleted file mode 100644 index 315bf717d1..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/RuntimeHelper.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace GitVersion.Core.Tests.Helpers; - -public static class RuntimeHelper -{ -#if !NETFRAMEWORK - private static bool? _isCoreClr; -#endif - - public static bool IsCoreClr() - { -#if !NETFRAMEWORK - _isCoreClr ??= System.Environment.Version.Major >= 5 - || System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET Core"); - return _isCoreClr.Value; -#else -#pragma warning disable IDE0022 // Use expression body for methods // Cannot be set because of the pragma section - return false; -#pragma warning restore IDE0022 // Use expression body for methods -#endif - } -} diff --git a/src/GitVersion.Core.Tests/Helpers/TestBase.cs b/src/GitVersion.Core.Tests/Helpers/TestBase.cs index 4a9fd08050..f39d61baa5 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestBase.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestBase.cs @@ -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? overrideServices = null) diff --git a/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs index c5b66e8055..714acd8da3 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/WorktreeScenarios.cs @@ -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(); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs index 9ffaa56d5e..6950c2b0d2 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs @@ -13,8 +13,6 @@ public class JsonVersionBuilderTests : TestBase public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void Json() { var semanticVersion = new SemanticVersion diff --git a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs index 60b393e942..c72fbe6765 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs @@ -48,8 +48,6 @@ public void ShouldLogWarningWhenUsingDefaultInformationalVersionInCustomFormat() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeliveryModeForPreRelease() { var semVer = new SemanticVersion @@ -75,8 +73,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreRelease() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding() { var semVer = new SemanticVersion @@ -102,8 +98,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeploymentModeForPreRelease() { var semVer = new SemanticVersion @@ -128,8 +122,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForPreRelease() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeliveryModeForStable() { var semVer = new SemanticVersion @@ -153,8 +145,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeploymentModeForStable() { var semVer = new SemanticVersion @@ -178,8 +168,6 @@ public void ProvidesVariablesInContinuousDeploymentModeForStable() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged() { var semVer = new SemanticVersion @@ -251,8 +239,6 @@ public void ProvidesVariablesInContinuousDeploymentModeWithTagSetToUseBranchName } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch() { var semVer = new SemanticVersion @@ -278,8 +264,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat() { var semVer = new SemanticVersion diff --git a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs b/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs index d0f95dbd83..86c884f0fe 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs @@ -35,8 +35,6 @@ public void Setup() [TestCase("cs")] [TestCase("fs")] [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { var workingDir = Path.GetTempPath(); @@ -53,8 +51,6 @@ public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(strin [TestCase("cs")] [TestCase("fs")] [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { var workingDir = Path.GetTempPath(); @@ -71,8 +67,6 @@ public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo [TestCase("cs")] [TestCase("fs")] [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInfo(string fileExtension) { var workingDir = Path.GetTempPath(); @@ -162,8 +156,6 @@ public void ShouldReplaceAssemblyVersion(string fileExtension, string assemblyFi [TestCase("cs", "[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] [TestCase("fs", "[]")] [TestCase("vb", "")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldNotReplaceAssemblyVersionWhenVersionSchemeIsNone(string fileExtension, string assemblyFileContent) { var workingDir = Path.GetTempPath(); @@ -375,8 +367,6 @@ public void ShouldReplaceAssemblyVersionInRelativePathWithVariablesAndWhiteSpace [TestCase("cs", "[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] [TestCase("fs", "[]\r\n[]")] [TestCase("vb", "\r\n")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile(string fileExtension, string assemblyFileContent) { var workingDir = Path.GetTempPath(); @@ -396,8 +386,6 @@ public void ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile [TestCase("cs", "[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n// comment\r\n")] [TestCase("fs", "[]\r\n[]\r\ndo\r\n()\r\n")] [TestCase("vb", "\r\n\r\n' comment\r\n")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes(string fileExtension, string assemblyFileContent) { var workingDir = Path.GetTempPath(); @@ -417,8 +405,6 @@ public void Issue1183ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttri [TestCase("cs", "[assembly: AssemblyFileVersion(\"1.0.0.0\")]")] [TestCase("fs", "[]")] [TestCase("vb", "")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldNotAddAssemblyInformationalVersionWhenVersionSchemeIsNone(string fileExtension, string assemblyFileContent) { var workingDir = Path.GetTempPath(); diff --git a/src/GitVersion.Core.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs b/src/GitVersion.Core.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs index 7237646c87..9fc1516c32 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs @@ -18,8 +18,6 @@ public class GitVersionInfoGeneratorTests : TestBase [TestCase("cs")] [TestCase("fs")] [TestCase("vb")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void ShouldCreateFile(string fileExtension) { var directory = Path.GetTempPath(); diff --git a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs b/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs index 5aab0aa92d..d12b0b8849 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs @@ -37,8 +37,6 @@ public void Setup() this.projectFileUpdater = new ProjectFileUpdater(this.log, this.fileSystem); } - [Category(NoMono)] - [Description(NoMonoDescription)] [TestCase("Microsoft.NET.Sdk")] [TestCase("Microsoft.NET.Sdk.Worker")] [TestCase("Microsoft.NET.Sdk.Web")] @@ -69,8 +67,6 @@ public void CanUpdateProjectFileWithSdkProjectFileXml(string sdk) ")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CannotUpdateProjectFileWithIncorrectProjectSdk(string xml) { var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); @@ -90,8 +86,6 @@ public void CannotUpdateProjectFileWithIncorrectProjectSdk(string xml) ")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CannotUpdateProjectFileWithMissingProjectSdk(string xml) { var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); @@ -112,8 +106,6 @@ public void CannotUpdateProjectFileWithMissingProjectSdk(string xml) ")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CannotUpdateProjectFileWithoutAssemblyInfoGeneration(string xml) { var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); @@ -129,8 +121,6 @@ public void CannotUpdateProjectFileWithoutAssemblyInfoGeneration(string xml) ")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void CannotUpdateProjectFileWithoutAPropertyGroup(string xml) { var canUpdate = projectFileUpdater.CanUpdateProjectFile(XElement.Parse(xml)); @@ -150,8 +140,6 @@ public void CannotUpdateProjectFileWithoutAPropertyGroup(string xml) " )] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string xml) { var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); @@ -179,8 +167,6 @@ public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string x " )] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string xml) { var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); @@ -211,8 +197,6 @@ public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string " )] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLastElement(string xml) { var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); @@ -244,8 +228,6 @@ public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLas " )] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsModified(string xml) { var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); @@ -272,8 +254,6 @@ public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsMo netcoreapp3.1 ")] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateProjectFileAddsVersionToFile(string xml) { var fileName = PathHelper.Combine(Path.GetTempPath(), "TestProject.csproj"); diff --git a/src/GitVersion.Core.Tests/VersionConverters/WixFileTests.cs b/src/GitVersion.Core.Tests/VersionConverters/WixFileTests.cs index 3e5758bb81..155d5c172b 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/WixFileTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/WixFileTests.cs @@ -17,8 +17,6 @@ internal class WixFileTests : TestBase public void Setup() => ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute(); [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateWixVersionFile() { var workingDir = Path.GetTempPath(); @@ -60,8 +58,6 @@ public void UpdateWixVersionFile() } [Test] - [Category(NoMono)] - [Description(NoMonoDescription)] public void UpdateWixVersionFileWhenFileAlreadyExists() { var workingDir = Path.GetTempPath(); diff --git a/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj b/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj index b742926fed..6212a50654 100644 --- a/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj +++ b/src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj @@ -1,7 +1,7 @@ - net48;netcoreapp3.1;net6.0 + netcoreapp3.1;net6.0 true @@ -12,7 +12,7 @@ - + @@ -30,7 +30,6 @@ - diff --git a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs index 831c0ea14b..31d5c9bc47 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildExeFixture.cs @@ -2,13 +2,7 @@ using Buildalyzer.Environment; using GitTools.Testing; using GitVersion.Core.Tests; -using GitVersion.Core.Tests.Helpers; using GitVersion.Helpers; - -#if NET48 -using GitVersion.Extensions; -#endif - using Microsoft.Build.Framework; using Microsoft.Build.Logging; using Microsoft.Build.Utilities.ProjectCreation; @@ -68,10 +62,7 @@ public MsBuildExeFixtureResult Execute() public void CreateTestProject(Action extendProject) { - var project = RuntimeHelper.IsCoreClr() - ? ProjectCreator.Templates.SdkCsproj(this.ProjectPath) - : ProjectCreator.Templates.LegacyCsproj(this.ProjectPath, defaultTargets: null, targetFrameworkVersion: "v4.8", toolsVersion: "15.0"); - + var project = ProjectCreator.Templates.SdkCsproj(this.ProjectPath); if (project == null) return; extendProject(project); diff --git a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs index ab66d452c4..c07d4e655e 100644 --- a/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs +++ b/src/GitVersion.MsBuild.Tests/Helpers/MsBuildTaskFixture.cs @@ -2,11 +2,6 @@ using GitVersion.BuildAgents; using GitVersion.Core.Tests; using GitVersion.Helpers; - -#if NET48 -using GitVersion.Extensions; -#endif - using GitVersion.MsBuild.Tests.Mocks; namespace GitVersion.MsBuild.Tests.Helpers; diff --git a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs index bb5c895104..3a96d4f637 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs @@ -51,8 +51,6 @@ public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServer() } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild() { const string taskName = nameof(GenerateGitVersionInformation); @@ -78,8 +76,6 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild( } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildInBuildServer() { const string taskName = nameof(GenerateGitVersionInformation); diff --git a/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs b/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs index b82843315d..27533cc3ea 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs @@ -61,8 +61,6 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesForBuildServer() [TestCase(nameof(VersionVariables.Patch), "4")] [TestCase(nameof(VersionVariables.MajorMinorPatch), "1.2.4")] [TestCase(nameof(VersionVariables.FullSemVer), "1.2.4+1")] - [Category(NoNet48)] - [Category(NoMono)] public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(string outputProperty, string version) { const string taskName = nameof(GetVersion); @@ -82,8 +80,6 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(s [TestCase(nameof(VersionVariables.Patch), "1")] [TestCase(nameof(VersionVariables.MajorMinorPatch), "1.0.1")] [TestCase(nameof(VersionVariables.FullSemVer), "1.0.1+1")] - [Category(NoNet48)] - [Category(NoMono)] public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuildInBuildServer(string outputProperty, string version) { const string taskName = nameof(GetVersion); diff --git a/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs index 766a385dea..acee7d792b 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/UpdateAssemblyInfoTaskTest.cs @@ -42,8 +42,6 @@ public void UpdateAssemblyInfoTaskShouldCreateFileInBuildServer() } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuild() { const string taskName = nameof(UpdateAssemblyInfo); @@ -65,8 +63,6 @@ public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuild() } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void UpdateAssemblyInfoTaskShouldCreateFileWhenRunWithMsBuildInBuildServer() { const string taskName = nameof(UpdateAssemblyInfo); diff --git a/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs index c382de4655..0b757cbb2a 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/WriteVersionInfoTest.cs @@ -89,8 +89,6 @@ public void WriteVersionInfoTaskShouldLogOutputVariablesToBuildOutputInGitHubAct } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void WriteVersionInfoTaskShouldNotLogOutputVariablesToBuildOutputWhenRunWithMsBuild() { const string taskName = nameof(WriteVersionInfoToBuildLog); @@ -106,8 +104,6 @@ public void WriteVersionInfoTaskShouldNotLogOutputVariablesToBuildOutputWhenRunW } [Test] - [Category(NoNet48)] - [Category(NoMono)] public void WriteVersionInfoTaskShouldLogOutputVariablesToBuildOutputWhenRunWithMsBuildInAzurePipeline() { const string taskName = nameof(WriteVersionInfoToBuildLog); diff --git a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props index 266236f7fb..988679c33f 100644 --- a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props +++ b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props @@ -19,11 +19,6 @@ $(GitVersion_ToolArgments) -nocache - - "$(MSBuildThisFileDirectory)net48/gitversion.exe" - $(MSBuildThisFileDirectory)net48/GitVersion.MsBuild.dll - - dotnet --roll-forward Major "$(MSBuildThisFileDirectory)netcoreapp3.1/gitversion.dll" $(MSBuildThisFileDirectory)netcoreapp3.1/GitVersion.MsBuild.dll diff --git a/src/GitVersion.MsBuild/nuget-files.props b/src/GitVersion.MsBuild/nuget-files.props index 79c534bf75..445e868e0e 100644 --- a/src/GitVersion.MsBuild/nuget-files.props +++ b/src/GitVersion.MsBuild/nuget-files.props @@ -1,10 +1,8 @@ - ../GitVersion.App/bin/$(Configuration)/net48 ../GitVersion.App/bin/$(Configuration)/netcoreapp3.1/publish ../GitVersion.App/bin/$(Configuration)/net6.0/publish - tools/net48 tools/netcoreapp3.1 tools/net6.0 @@ -13,11 +11,9 @@ - - diff --git a/tests/integration/full/app.csproj b/tests/integration/full/app.csproj deleted file mode 100644 index 67a478fbf0..0000000000 --- a/tests/integration/full/app.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Debug - AnyCPU - {C1765652-F8AE-4FFD-AFC8-72054A5A91B7} - v4.8 - 512 - true - true - - - AnyCPU - true - full - false - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - TRACE - prompt - 4 - - - - - - - - - - - - - -