From 4f3b38117b2dc7214aa802c2d53c0f5deb46cc45 Mon Sep 17 00:00:00 2001 From: "C. Augusto Proiete" Date: Tue, 30 Nov 2021 21:05:02 -0400 Subject: [PATCH] Update Cake.MinVer add-in to target Cake v2.0.0 (#23) --- .github/workflows/ci.yml | 6 +++- global.json | 2 +- src/Cake.MinVer/Cake.MinVer.csproj | 6 ++-- src/Cake.MinVer/MinVerSettings.cs | 6 ++-- src/Cake.MinVer/MinVerTool.cs | 4 +-- src/Cake.MinVer/MinVerToolBase.cs | 16 +++++----- .../Cake.MinVer.Tests.csproj | 8 ++--- ..._Shallow_Clone_All_Properties.verified.txt | 29 ++----------------- test/Cake.MinVer.Tests/MinVerSettingsTests.cs | 4 +-- 9 files changed, 31 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ae4df0..64bb568 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,9 +28,9 @@ jobs: job: - os: ubuntu-18.04 build: ./build.sh - push: true - os: ubuntu-20.04 build: ./build.sh + push: true - os: windows-2019 build: ./build.cmd - os: windows-2022 @@ -50,6 +50,10 @@ jobs: uses: actions/setup-dotnet@v1.9.0 with: dotnet-version: "5.0.401" + - name: Setup net6.0 + uses: actions/setup-dotnet@v1.8.2 + with: + dotnet-version: "6.0.100" - name: Run dotnet --info run: dotnet --info - uses: actions/checkout@v2.4.0 diff --git a/global.json b/global.json index 5f35d39..cb771af 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": false, - "version": "5.0.100", + "version": "6.0.100", "rollForward": "latestFeature" } } diff --git a/src/Cake.MinVer/Cake.MinVer.csproj b/src/Cake.MinVer/Cake.MinVer.csproj index fcbea27..6537f03 100644 --- a/src/Cake.MinVer/Cake.MinVer.csproj +++ b/src/Cake.MinVer/Cake.MinVer.csproj @@ -1,7 +1,7 @@  - net5.0;netstandard2.0 + net6.0;net5.0;netcoreapp3.1 Cake.MinVer Cake.MinVer @@ -40,8 +40,8 @@ - - + + diff --git a/src/Cake.MinVer/MinVerSettings.cs b/src/Cake.MinVer/MinVerSettings.cs index 3057fb5..19aec71 100644 --- a/src/Cake.MinVer/MinVerSettings.cs +++ b/src/Cake.MinVer/MinVerSettings.cs @@ -15,7 +15,7 @@ #endregion using System; -using Cake.Common.Tools.DotNetCore; +using Cake.Common.Tools.DotNet; using Cake.Core.IO; namespace Cake.MinVer @@ -23,7 +23,7 @@ namespace Cake.MinVer /// /// Contains settings used by . /// - public class MinVerSettings : DotNetCoreSettings, ICloneable + public class MinVerSettings : DotNetSettings, ICloneable { /// /// Set the version part to be automatically incremented. @@ -95,7 +95,7 @@ public class MinVerSettings : DotNetCoreSettings, ICloneable /// public new MinVerVerbosity? Verbosity { get; set; } - internal DotNetCoreVerbosity? ToolVerbosity + internal DotNetVerbosity? ToolVerbosity { get => base.Verbosity; set => base.Verbosity = value; diff --git a/src/Cake.MinVer/MinVerTool.cs b/src/Cake.MinVer/MinVerTool.cs index f388029..d66de66 100644 --- a/src/Cake.MinVer/MinVerTool.cs +++ b/src/Cake.MinVer/MinVerTool.cs @@ -16,7 +16,7 @@ using System; using System.Globalization; -using Cake.Common.Tools.DotNetCore; +using Cake.Common.Tools.DotNet; using Cake.Core; using Cake.Core.Diagnostics; using Cake.Core.IO; @@ -28,7 +28,7 @@ namespace Cake.MinVer /// /// MinVer dotnet tool. /// - public class MinVerTool : DotNetCoreTool + public class MinVerTool : DotNetTool { private readonly IMinVerLocalTool _localTool; private readonly IMinVerGlobalTool _globalTool; diff --git a/src/Cake.MinVer/MinVerToolBase.cs b/src/Cake.MinVer/MinVerToolBase.cs index cb4aa43..8181b40 100644 --- a/src/Cake.MinVer/MinVerToolBase.cs +++ b/src/Cake.MinVer/MinVerToolBase.cs @@ -17,7 +17,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Cake.Common.Tools.DotNetCore; +using Cake.Common.Tools.DotNet; using Cake.Core; using Cake.Core.Diagnostics; using Cake.Core.IO; @@ -25,7 +25,7 @@ namespace Cake.MinVer { - internal abstract class MinVerToolBase : DotNetCoreTool, IMinVerTool + internal abstract class MinVerToolBase : DotNetTool, IMinVerTool { protected MinVerToolBase(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools, ICakeLog log) @@ -250,15 +250,15 @@ private static void AppendVerbosity(ProcessArgumentBuilder args, MinVerSettings } } - private static MinVerVerbosity ToolToMinVerVerbosityConverter(DotNetCoreVerbosity toolVerbosity) + private static MinVerVerbosity ToolToMinVerVerbosityConverter(DotNetVerbosity toolVerbosity) { return toolVerbosity switch { - DotNetCoreVerbosity.Quiet => MinVerVerbosity.Error, - DotNetCoreVerbosity.Minimal => MinVerVerbosity.Warn, - DotNetCoreVerbosity.Normal => MinVerVerbosity.Info, - DotNetCoreVerbosity.Detailed => MinVerVerbosity.Debug, - DotNetCoreVerbosity.Diagnostic => MinVerVerbosity.Trace, + DotNetVerbosity.Quiet => MinVerVerbosity.Error, + DotNetVerbosity.Minimal => MinVerVerbosity.Warn, + DotNetVerbosity.Normal => MinVerVerbosity.Info, + DotNetVerbosity.Detailed => MinVerVerbosity.Debug, + DotNetVerbosity.Diagnostic => MinVerVerbosity.Trace, _ => MinVerVerbosity.Info }; } diff --git a/test/Cake.MinVer.Tests/Cake.MinVer.Tests.csproj b/test/Cake.MinVer.Tests/Cake.MinVer.Tests.csproj index 051e92f..95e13d0 100644 --- a/test/Cake.MinVer.Tests/Cake.MinVer.Tests.csproj +++ b/test/Cake.MinVer.Tests/Cake.MinVer.Tests.csproj @@ -1,14 +1,14 @@  - net5.0;netcoreapp3.1 + net6.0;net5.0;netcoreapp3.1 false - - - + + + diff --git a/test/Cake.MinVer.Tests/MinVerSettingsTests.Should_Shallow_Clone_All_Properties.verified.txt b/test/Cake.MinVer.Tests/MinVerSettingsTests.Should_Shallow_Clone_All_Properties.verified.txt index c86812f..935a81c 100644 --- a/test/Cake.MinVer.Tests/MinVerSettingsTests.Should_Shallow_Clone_All_Properties.verified.txt +++ b/test/Cake.MinVer.Tests/MinVerSettingsTests.Should_Shallow_Clone_All_Properties.verified.txt @@ -3,38 +3,15 @@ BuildMetadata: 123, DefaultPreReleasePhase: preview, MinimumMajorMinor: 1.2, - Repo: { - FullPath: /repo/custom, - Separator: "/", - Segments: [ - /repo, - custom - ] - }, + Repo: /repo/custom, TagPrefix: v, PreferGlobalTool: true, NoFallback: true, Verbosity: Trace, DiagnosticOutput: true, - ToolPath: { - HasExtension: true, - FullPath: /tools/custom/minver.exe, - Separator: "/", - Segments: [ - /tools, - custom, - minver.exe - ] - }, + ToolPath: /tools/custom/minver.exe, ToolTimeout: 00:05:00, - WorkingDirectory: { - FullPath: /working/folder, - Separator: "/", - Segments: [ - /working, - folder - ] - }, + WorkingDirectory: /working/folder, NoWorkingDirectory: true, ArgumentCustomization: { Type: Func, diff --git a/test/Cake.MinVer.Tests/MinVerSettingsTests.cs b/test/Cake.MinVer.Tests/MinVerSettingsTests.cs index efba3f8..ff78066 100644 --- a/test/Cake.MinVer.Tests/MinVerSettingsTests.cs +++ b/test/Cake.MinVer.Tests/MinVerSettingsTests.cs @@ -17,7 +17,7 @@ using System; using System.Collections.Generic; using Xunit; -using Cake.Common.Tools.DotNetCore; +using Cake.Common.Tools.DotNet; using Cake.Core.IO; using VerifyXunit; using System.Threading.Tasks; @@ -41,7 +41,7 @@ public Task Should_Shallow_Clone_All_Properties() PreferGlobalTool = true, NoFallback = true, Verbosity = MinVerVerbosity.Trace, - ToolVerbosity = DotNetCoreVerbosity.Detailed, + ToolVerbosity = DotNetVerbosity.Detailed, DiagnosticOutput = true, ToolPath = FilePath.FromString("/tools/custom/minver.exe"),