From 0e4f39ed8ad9eb35df23f175d268959f0161b1c6 Mon Sep 17 00:00:00 2001 From: Kieranties Date: Tue, 25 Feb 2020 23:10:14 +0000 Subject: [PATCH 1/5] feature(cake): Remove cake plugin in favour of netcore tool --- .gitignore | 1 + Packages.props | 11 ++- SimpleVersion.sln | 7 -- docs/articles/intro.md | 67 ++++++++++++++---- src/SimpleVersion.Cake/CakeAliases.cs | 36 ---------- .../SimpleVersion.Cake.csproj | 32 --------- src/SimpleVersion.Cake/logo.png | Bin 3519 -> 0 bytes .../SimpleVersion.Core.csproj | 5 +- .../SimpleVersion.Tool.csproj | 2 - 9 files changed, 62 insertions(+), 99 deletions(-) delete mode 100644 src/SimpleVersion.Cake/CakeAliases.cs delete mode 100644 src/SimpleVersion.Cake/SimpleVersion.Cake.csproj delete mode 100644 src/SimpleVersion.Cake/logo.png diff --git a/.gitignore b/.gitignore index 5752a0a..56d106d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ log.txt /docs/api/.manifest coverage.json dotnet-install.ps1 +tools diff --git a/Packages.props b/Packages.props index 13f558b..615537e 100644 --- a/Packages.props +++ b/Packages.props @@ -5,10 +5,9 @@ Centrally managed packages for all projects in the solution --> - - - - + + + @@ -28,7 +27,7 @@ - - + + diff --git a/SimpleVersion.sln b/SimpleVersion.sln index e574add..d630729 100644 --- a/SimpleVersion.sln +++ b/SimpleVersion.sln @@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleVersion.Core.Tests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleVersion.Abstractions.Tests", "test\SimpleVersion.Abstractions.Tests\SimpleVersion.Abstractions.Tests.csproj", "{D95890EA-093F-4FAD-8E30-E372DD946F32}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleVersion.Cake", "src\SimpleVersion.Cake\SimpleVersion.Cake.csproj", "{3A9E63F3-574A-4FB9-B00D-685AE077E0BF}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{385532A7-26BE-4596-9EEE-E7C3984643ED}" ProjectSection(SolutionItems) = preProject shared\logo.png = shared\logo.png @@ -71,10 +69,6 @@ Global {D95890EA-093F-4FAD-8E30-E372DD946F32}.Debug|Any CPU.Build.0 = Debug|Any CPU {D95890EA-093F-4FAD-8E30-E372DD946F32}.Release|Any CPU.ActiveCfg = Release|Any CPU {D95890EA-093F-4FAD-8E30-E372DD946F32}.Release|Any CPU.Build.0 = Release|Any CPU - {3A9E63F3-574A-4FB9-B00D-685AE077E0BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A9E63F3-574A-4FB9-B00D-685AE077E0BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A9E63F3-574A-4FB9-B00D-685AE077E0BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A9E63F3-574A-4FB9-B00D-685AE077E0BF}.Release|Any CPU.Build.0 = Release|Any CPU {283AA9B6-B543-43C9-B512-BA54B36799B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {283AA9B6-B543-43C9-B512-BA54B36799B4}.Debug|Any CPU.Build.0 = Debug|Any CPU {283AA9B6-B543-43C9-B512-BA54B36799B4}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -88,7 +82,6 @@ Global {C3908FD1-A959-4687-9221-C058698B126A} = {D5992CB5-3542-41C8-BE85-F52699729C57} {C367CC5A-5ACC-442A-8885-ED9A94A9A43E} = {9EEF54AE-EEE2-4817-B0D0-AFAE3F52C231} {D95890EA-093F-4FAD-8E30-E372DD946F32} = {9EEF54AE-EEE2-4817-B0D0-AFAE3F52C231} - {3A9E63F3-574A-4FB9-B00D-685AE077E0BF} = {D5992CB5-3542-41C8-BE85-F52699729C57} {283AA9B6-B543-43C9-B512-BA54B36799B4} = {D5992CB5-3542-41C8-BE85-F52699729C57} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/docs/articles/intro.md b/docs/articles/intro.md index 71704e4..f2f9b74 100644 --- a/docs/articles/intro.md +++ b/docs/articles/intro.md @@ -11,7 +11,7 @@ Dotnet Tool ----------------- The latest version of the dotnet tool can be found on nuget.org. -You can install SimpleVersion.Tool the [dotnet cli]: +You can install `SimpleVersion.Tool` the [dotnet cli]: ```posh # Installs the latest version as a global tool @@ -25,17 +25,25 @@ PS c:\MyRepo> simpleversion PS c:\> simpleversion ./MyRepo ``` -Cake Addin ----------- +Usage in Cake +------------- -The `Cake.SimpleVersion` addin can be used in a Cake build script to invoke -SimpleVersion. +The dotnet tool can be integrated into a Cake build script. This makes use +of the [Cake.DotNetTool.Module] to enable installing `SimpleVersion.Tool`. +> You will need to run `.\build.ps1 --bootstrap` prior to running `.\build.ps1` to ensure correct installation of the tool. A simple `build.cake` can invoke the `SimpleVersion`: ```c# -// Include the Cake addin -#addin nuget:?package=Cake.SimpleVersion&prerelease +// Install dotnet core tool module +#module nuget:?package=Cake.DotNetTool.Module&version=0.4.0 +// Install SimpleVersion dotnet tool +#tool dotnet:?package=SimpleVersion.Tool&version=0.3.0 +// Install newtonsoft to parse result +#addin nuget:?package=Newtonsoft.Json&version=12.0.3 +// Import newtonsoft namespace for parsing +using Newtonsoft.Json.Linq; + ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// @@ -43,9 +51,6 @@ A simple `build.cake` can invoke the `SimpleVersion`: var target = Argument("target", "Default"); var versionFormat = Argument("versionFormat", "Semver1"); -// Call SimpleVersion to get version information -var versionInfo = SimpleVersion(); - ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// @@ -53,8 +58,18 @@ var versionInfo = SimpleVersion(); Task("Build") .Does(() => { - // Display version - Access formats dictionary or other properties - Information($"My {versionFormat} is: {versionInfo.Formats[versionFormat]}"); + // Call SimpleVersion to get version information + StartProcess( + Context.Tools.Resolve("simpleversion.exe"), + new ProcessSettings{ RedirectStandardOutput = true }, + out var simpleVersionOut // capture output for parsing + ); + + // Parse json result + dynamic simpleVersion = JObject.Parse(string.Join("", simpleVersionOut)); + + // Display version - Access formats dictionary or other properties + Information(simpleVersion.Formats[versionFormat]); }); ////////////////////////////////////////////////////////////////////// @@ -70,7 +85,33 @@ Task("Default") RunTarget(target); ``` +Which can then be invoked as: +```posh +▶ .\build.ps1 --bootstrap; .\build.ps1 +Preparing to run build script... +Running build script... +Preparing to run build script... +Running build script... + +======================================== +Build +======================================== +0.3.0-alpha1-0002-c6c70600 + +======================================== +Default +======================================== + +Task Duration +-------------------------------------------------- +Build 00:00:00.3256116 +-------------------------------------------------- +Total: 00:00:00.3304598 +``` +> You change the arguments passed to `SimpleVersion` using the [ProcessSettings] class. [Results]: ./results.md -[dotnet cli]: https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools \ No newline at end of file +[dotnet cli]: https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools +[Cake.DotNetTool.Module]: https://www.gep13.co.uk/blog/introducing-cake.dotnettool.module +[ProcessSettings]: https://cakebuild.net/api/Cake.Core.IO/ProcessSettings/ \ No newline at end of file diff --git a/src/SimpleVersion.Cake/CakeAliases.cs b/src/SimpleVersion.Cake/CakeAliases.cs deleted file mode 100644 index 2392751..0000000 --- a/src/SimpleVersion.Cake/CakeAliases.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. - -using Cake.Core; -using Cake.Core.Annotations; -using SimpleVersion; -using SimpleVersion.Extensions; -using SimpleVersion.Model; - -namespace Cake.SimpleVersion -{ - /// - /// Aliases exposed to Cake. - /// - public static class CakeAliases - { - /// - /// Cake method alias to invoke SimpleVersion. - /// - /// The of the current build. - /// The path to the repository to version. - /// An with details of the calculated version. - [CakeMethodAlias] - public static VersionResult SimpleVersion( - this ICakeContext context, - string? path = null) - { - Assert.ArgumentNotNull(context, nameof(context)); - - path = path.DefaultIfNullOrWhiteSpace(context.Environment.WorkingDirectory.FullPath); - - return VersionCalculator - .Default() - .GetResult(path!); // ! null check is completed above - } - } -} diff --git a/src/SimpleVersion.Cake/SimpleVersion.Cake.csproj b/src/SimpleVersion.Cake/SimpleVersion.Cake.csproj deleted file mode 100644 index f8160a9..0000000 --- a/src/SimpleVersion.Cake/SimpleVersion.Cake.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - - netstandard2.1 - Cake.SimpleVersion - $(PackageTags);Cake - - - - - - - - - - - - $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs - - - - - - lib\$(TargetFramework)\ - - - - - diff --git a/src/SimpleVersion.Cake/logo.png b/src/SimpleVersion.Cake/logo.png deleted file mode 100644 index ecc9fa47c1808e6fb1c9003f1c35de2ec42c8f15..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3519 zcmV;w4M6gVP)uhzPayj8`AbqNZV8? z$9K*>P5vbR|L*th^4HaQ%$`J{|lu}nkj-N38rd3qqCv;bcT{Q}c zpmu?a%Wpca=ZIbZmKQn%MF}C$N6E}e$)Ghx7nk4ObO4ZIy9#3ip^FehDHa+n*F|n? z@*|{Zs43#alpFz#-19)DSl~I}l~zfG#cDr~N0bs*HJSK3)yk2Wpv#2X-{Uxad& zI`%!I#O2Q_x!2_ay4Fx#Yyn}iL5ciO5&d@1LjMn>K8=& zbIOg+%OErN_>NhIG1BD^N{L`&ZiEb#IjI%^n9LZbhapA|g}?A=_Pqh(>u%{vsnERr z;kB?H+crD|ZO9PJtTb@S>4*A5MHZ4P_xwKB&wYo6KGVkpU{+0WClJ{Cl9WiO0VxgXkzQMfnIoG)%{)d$E6>BKmq0Y z!h|r20me>Bm83?YY-B71#P$#TDd2xlEs*%@yDX_5G<(( z`gadBePl6%llkj>I63L|{5yfzy9 zAJ4+oqa`r^uN0rWsKIQlyp@1xVXU)Xm2XdB2g~Dpe)@Em8VvmdFYn|9p!w<*ESXpV zO)v$!ga{O+4&`-;u2PwmOy3XZGDy=~Z&>bk`uH(C_0S4T&Q9f?n;-0jzt_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8XH;A(+Lf#KS5AoHYKd(Rq+rvWIL<<>SG`@X=7h8>u+prW|8t|sy4Fn&b+lbgKC*>};_v~A&6gR85Bk$aH^$rG@%gs92f0dGNn@Hic tw93zu&+k%5gq!GE-A%3duVa9W{{urXlZ_)%>9+s?002ovPDHLkV1gG!i}3&e diff --git a/src/SimpleVersion.Core/SimpleVersion.Core.csproj b/src/SimpleVersion.Core/SimpleVersion.Core.csproj index 85bdf2d..d8c5226 100644 --- a/src/SimpleVersion.Core/SimpleVersion.Core.csproj +++ b/src/SimpleVersion.Core/SimpleVersion.Core.csproj @@ -1,4 +1,4 @@ - + @@ -7,8 +7,7 @@ - - + diff --git a/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj b/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj index 2d6d2ac..743011e 100644 --- a/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj +++ b/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj @@ -4,8 +4,6 @@ netcoreapp3.1 Exe - - $(NoWarn);NU5128 true simpleversion From a61bf3dba3dd0c732b9151c2d8086b2a5008cb33 Mon Sep 17 00:00:00 2001 From: Kieranties Date: Tue, 25 Feb 2020 23:10:14 +0000 Subject: [PATCH 2/5] feature(cake): Remove cake plugin in favour of netcore tool --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- Packages.props | 1 - docs/articles/intro.md | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index cbccb25..15aae06 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,7 +26,7 @@ If applicable, add screenshots to help explain your problem. **Environment** - OS: [e.g. Windows] - - Implementation: [e.g. Commandline, Cake, Libraries] + - Implementation: [e.g. Commandline, Dotnet Tool, Libraries] - Version [e.g. 0.1.0] **Additional context** diff --git a/Packages.props b/Packages.props index 615537e..4114d60 100644 --- a/Packages.props +++ b/Packages.props @@ -5,7 +5,6 @@ Centrally managed packages for all projects in the solution --> - diff --git a/docs/articles/intro.md b/docs/articles/intro.md index f2f9b74..886249c 100644 --- a/docs/articles/intro.md +++ b/docs/articles/intro.md @@ -1,8 +1,7 @@ Introduction ============ -SimpleVersion is available as a cross-platform dotnet tool, a netstandard Cake -addin, or as a collection of libraries for direct consumption in a project. +SimpleVersion is available as a cross-platform dotnet tool and core libraries for direct consumption in a project. To get a better understanding of the values returned from invoking SimpleVersion see the [results documentation][results]. From 3b2cfd95b1dabe9798ace5626a6a3c70ba9474a3 Mon Sep 17 00:00:00 2001 From: Kieranties Date: Tue, 17 Mar 2020 21:35:35 +0000 Subject: [PATCH 3/5] chore: Clean up abstractions namespaces --- Directory.Build.props | 7 ------- src/SimpleVersion.Abstractions/Exceptions/GitException.cs | 2 +- src/SimpleVersion.Abstractions/IEnvironment.cs | 2 +- src/SimpleVersion.Abstractions/IVersionCalculator.cs | 2 +- src/SimpleVersion.Abstractions/Pipeline/IVersionContext.cs | 2 +- .../Pipeline/IVersionContextProcessor.cs | 2 +- src/SimpleVersion.Abstractions/Rules/ITokenRule.cs | 4 ++-- .../SimpleVersion.Abstractions.csproj | 1 + src/SimpleVersion.Core/Assert.cs | 4 ++-- .../Pipeline/AzureDevopsContextProcessor.cs | 2 -- .../Pipeline/Formatting/Semver1FormatProcess.cs | 2 -- .../Pipeline/Formatting/Semver2FormatProcess.cs | 2 -- .../Pipeline/Formatting/VersionFormatProcess.cs | 1 - .../Pipeline/SettingsContextProcessor.cs | 3 +-- src/SimpleVersion.Core/Pipeline/VersionContext.cs | 3 +-- src/SimpleVersion.Core/Rules/BaseBranchNameTokenRule.cs | 2 -- src/SimpleVersion.Core/Rules/BranchNameSuffixTokenRule.cs | 2 +- src/SimpleVersion.Core/Rules/BranchNameTokenRule.cs | 2 +- src/SimpleVersion.Core/Rules/HeightTokenRule.cs | 3 +-- src/SimpleVersion.Core/Rules/PullRequestIdTokenRule.cs | 3 +-- src/SimpleVersion.Core/Rules/ShortBranchNameTokenRule.cs | 2 +- src/SimpleVersion.Core/Rules/ShortShaTokenRule.cs | 3 +-- src/SimpleVersion.Core/Rules/TokenRuleExtensions.cs | 2 -- src/SimpleVersion.Core/VersionCalculator.cs | 2 -- src/SimpleVersion.Core/VersioningEnvironment.cs | 2 -- test/Directory.Build.props | 2 +- .../Exceptions/GitExceptionFixture.cs | 4 ++-- .../SimpleVersion.Abstractions.Tests.csproj | 2 +- .../Pipeline/AzureDevopsContextProcessorFixture.cs | 1 - .../Pipeline/VersionContextFixture.cs | 2 +- .../Rules/TokenRuleExtensionsFixture.cs | 1 - 31 files changed, 23 insertions(+), 51 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 8ed7138..872e5b3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -44,11 +44,4 @@ - - - true - - - - diff --git a/src/SimpleVersion.Abstractions/Exceptions/GitException.cs b/src/SimpleVersion.Abstractions/Exceptions/GitException.cs index e5883c1..314ebca 100644 --- a/src/SimpleVersion.Abstractions/Exceptions/GitException.cs +++ b/src/SimpleVersion.Abstractions/Exceptions/GitException.cs @@ -2,7 +2,7 @@ using System; -namespace SimpleVersion.Abstractions.Exceptions +namespace SimpleVersion.Exceptions { /// /// Represents a Git error within the application. diff --git a/src/SimpleVersion.Abstractions/IEnvironment.cs b/src/SimpleVersion.Abstractions/IEnvironment.cs index baf6e62..50f4fa3 100644 --- a/src/SimpleVersion.Abstractions/IEnvironment.cs +++ b/src/SimpleVersion.Abstractions/IEnvironment.cs @@ -1,6 +1,6 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. -namespace SimpleVersion.Abstractions +namespace SimpleVersion { /// /// Contract for accessing environment variables. diff --git a/src/SimpleVersion.Abstractions/IVersionCalculator.cs b/src/SimpleVersion.Abstractions/IVersionCalculator.cs index 7b68382..cefafed 100644 --- a/src/SimpleVersion.Abstractions/IVersionCalculator.cs +++ b/src/SimpleVersion.Abstractions/IVersionCalculator.cs @@ -2,7 +2,7 @@ using SimpleVersion.Model; -namespace SimpleVersion.Abstractions +namespace SimpleVersion { /// /// Contract for the calculation process. diff --git a/src/SimpleVersion.Abstractions/Pipeline/IVersionContext.cs b/src/SimpleVersion.Abstractions/Pipeline/IVersionContext.cs index d469d31..185eb60 100644 --- a/src/SimpleVersion.Abstractions/Pipeline/IVersionContext.cs +++ b/src/SimpleVersion.Abstractions/Pipeline/IVersionContext.cs @@ -2,7 +2,7 @@ using SimpleVersion.Model; -namespace SimpleVersion.Abstractions.Pipeline +namespace SimpleVersion.Pipeline { /// /// Encapsulates state during version calculation. diff --git a/src/SimpleVersion.Abstractions/Pipeline/IVersionContextProcessor.cs b/src/SimpleVersion.Abstractions/Pipeline/IVersionContextProcessor.cs index 503366e..d574b4b 100644 --- a/src/SimpleVersion.Abstractions/Pipeline/IVersionContextProcessor.cs +++ b/src/SimpleVersion.Abstractions/Pipeline/IVersionContextProcessor.cs @@ -1,6 +1,6 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. -namespace SimpleVersion.Abstractions.Pipeline +namespace SimpleVersion.Pipeline { /// /// Contract for a processor step during version calculation. diff --git a/src/SimpleVersion.Abstractions/Rules/ITokenRule.cs b/src/SimpleVersion.Abstractions/Rules/ITokenRule.cs index 43acd1d..f44295c 100644 --- a/src/SimpleVersion.Abstractions/Rules/ITokenRule.cs +++ b/src/SimpleVersion.Abstractions/Rules/ITokenRule.cs @@ -1,9 +1,9 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. using System.Collections.Generic; -using SimpleVersion.Abstractions.Pipeline; +using SimpleVersion.Pipeline; -namespace SimpleVersion.Abstractions.Rules +namespace SimpleVersion.Rules { /// /// Contract for a rule which applies for a specific token. diff --git a/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj b/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj index 438d5f9..3550e53 100644 --- a/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj +++ b/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj @@ -3,6 +3,7 @@ netstandard2.1 + SimpleVersion diff --git a/src/SimpleVersion.Core/Assert.cs b/src/SimpleVersion.Core/Assert.cs index 69eaadd..32a59c2 100644 --- a/src/SimpleVersion.Core/Assert.cs +++ b/src/SimpleVersion.Core/Assert.cs @@ -10,7 +10,7 @@ namespace SimpleVersion /// Simple exception handling asserts. /// [ExcludeFromCodeCoverage] - public static class Assert + internal static class Assert { /// /// Asserts the given argument value is not null. @@ -21,7 +21,7 @@ public static class Assert /// Thrown if the given value is null. /// The value if not null. [DebuggerStepThrough] - public static T ArgumentNotNull(T value, string name) + internal static T ArgumentNotNull(T value, string name) { if (value == null) { diff --git a/src/SimpleVersion.Core/Pipeline/AzureDevopsContextProcessor.cs b/src/SimpleVersion.Core/Pipeline/AzureDevopsContextProcessor.cs index 7877b65..65d7956 100644 --- a/src/SimpleVersion.Core/Pipeline/AzureDevopsContextProcessor.cs +++ b/src/SimpleVersion.Core/Pipeline/AzureDevopsContextProcessor.cs @@ -1,8 +1,6 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. using System.Text.RegularExpressions; -using SimpleVersion.Abstractions; -using SimpleVersion.Abstractions.Pipeline; using SimpleVersion.Extensions; namespace SimpleVersion.Pipeline diff --git a/src/SimpleVersion.Core/Pipeline/Formatting/Semver1FormatProcess.cs b/src/SimpleVersion.Core/Pipeline/Formatting/Semver1FormatProcess.cs index 1381c1a..4340447 100644 --- a/src/SimpleVersion.Core/Pipeline/Formatting/Semver1FormatProcess.cs +++ b/src/SimpleVersion.Core/Pipeline/Formatting/Semver1FormatProcess.cs @@ -1,7 +1,5 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. -using SimpleVersion.Abstractions.Pipeline; -using SimpleVersion.Abstractions.Rules; using SimpleVersion.Rules; namespace SimpleVersion.Pipeline.Formatting diff --git a/src/SimpleVersion.Core/Pipeline/Formatting/Semver2FormatProcess.cs b/src/SimpleVersion.Core/Pipeline/Formatting/Semver2FormatProcess.cs index 73ae740..d7d19cf 100644 --- a/src/SimpleVersion.Core/Pipeline/Formatting/Semver2FormatProcess.cs +++ b/src/SimpleVersion.Core/Pipeline/Formatting/Semver2FormatProcess.cs @@ -1,7 +1,5 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. -using SimpleVersion.Abstractions.Pipeline; -using SimpleVersion.Abstractions.Rules; using SimpleVersion.Rules; namespace SimpleVersion.Pipeline.Formatting diff --git a/src/SimpleVersion.Core/Pipeline/Formatting/VersionFormatProcess.cs b/src/SimpleVersion.Core/Pipeline/Formatting/VersionFormatProcess.cs index 76efa6a..23beb84 100644 --- a/src/SimpleVersion.Core/Pipeline/Formatting/VersionFormatProcess.cs +++ b/src/SimpleVersion.Core/Pipeline/Formatting/VersionFormatProcess.cs @@ -1,7 +1,6 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. using System; -using SimpleVersion.Abstractions.Pipeline; using SimpleVersion.Rules; namespace SimpleVersion.Pipeline.Formatting diff --git a/src/SimpleVersion.Core/Pipeline/SettingsContextProcessor.cs b/src/SimpleVersion.Core/Pipeline/SettingsContextProcessor.cs index f8df709..abdf3bc 100644 --- a/src/SimpleVersion.Core/Pipeline/SettingsContextProcessor.cs +++ b/src/SimpleVersion.Core/Pipeline/SettingsContextProcessor.cs @@ -6,9 +6,8 @@ using System.Linq; using System.Text.RegularExpressions; using LibGit2Sharp; -using SimpleVersion.Abstractions.Exceptions; -using SimpleVersion.Abstractions.Pipeline; using SimpleVersion.Comparers; +using SimpleVersion.Exceptions; using SimpleVersion.Model; using SimpleVersion.Serialization; diff --git a/src/SimpleVersion.Core/Pipeline/VersionContext.cs b/src/SimpleVersion.Core/Pipeline/VersionContext.cs index f5da136..65dad5b 100644 --- a/src/SimpleVersion.Core/Pipeline/VersionContext.cs +++ b/src/SimpleVersion.Core/Pipeline/VersionContext.cs @@ -1,7 +1,6 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. -using SimpleVersion.Abstractions.Exceptions; -using SimpleVersion.Abstractions.Pipeline; +using SimpleVersion.Exceptions; using SimpleVersion.Model; using Git = LibGit2Sharp; diff --git a/src/SimpleVersion.Core/Rules/BaseBranchNameTokenRule.cs b/src/SimpleVersion.Core/Rules/BaseBranchNameTokenRule.cs index a9c9e9c..b7a11d5 100644 --- a/src/SimpleVersion.Core/Rules/BaseBranchNameTokenRule.cs +++ b/src/SimpleVersion.Core/Rules/BaseBranchNameTokenRule.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Text.RegularExpressions; -using SimpleVersion.Abstractions.Pipeline; -using SimpleVersion.Abstractions.Rules; using SimpleVersion.Pipeline; namespace SimpleVersion.Rules diff --git a/src/SimpleVersion.Core/Rules/BranchNameSuffixTokenRule.cs b/src/SimpleVersion.Core/Rules/BranchNameSuffixTokenRule.cs index 1075196..845eff8 100644 --- a/src/SimpleVersion.Core/Rules/BranchNameSuffixTokenRule.cs +++ b/src/SimpleVersion.Core/Rules/BranchNameSuffixTokenRule.cs @@ -1,7 +1,7 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. using System; -using SimpleVersion.Abstractions.Pipeline; +using SimpleVersion.Pipeline; namespace SimpleVersion.Rules { diff --git a/src/SimpleVersion.Core/Rules/BranchNameTokenRule.cs b/src/SimpleVersion.Core/Rules/BranchNameTokenRule.cs index 5563f81..9efa9c2 100644 --- a/src/SimpleVersion.Core/Rules/BranchNameTokenRule.cs +++ b/src/SimpleVersion.Core/Rules/BranchNameTokenRule.cs @@ -1,7 +1,7 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. using System; -using SimpleVersion.Abstractions.Pipeline; +using SimpleVersion.Pipeline; namespace SimpleVersion.Rules { diff --git a/src/SimpleVersion.Core/Rules/HeightTokenRule.cs b/src/SimpleVersion.Core/Rules/HeightTokenRule.cs index f806d52..718e029 100644 --- a/src/SimpleVersion.Core/Rules/HeightTokenRule.cs +++ b/src/SimpleVersion.Core/Rules/HeightTokenRule.cs @@ -3,8 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; -using SimpleVersion.Abstractions.Pipeline; -using SimpleVersion.Abstractions.Rules; +using SimpleVersion.Pipeline; namespace SimpleVersion.Rules { diff --git a/src/SimpleVersion.Core/Rules/PullRequestIdTokenRule.cs b/src/SimpleVersion.Core/Rules/PullRequestIdTokenRule.cs index 14b6a0d..3eb1658 100644 --- a/src/SimpleVersion.Core/Rules/PullRequestIdTokenRule.cs +++ b/src/SimpleVersion.Core/Rules/PullRequestIdTokenRule.cs @@ -3,8 +3,7 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; -using SimpleVersion.Abstractions.Pipeline; -using SimpleVersion.Abstractions.Rules; +using SimpleVersion.Pipeline; namespace SimpleVersion.Rules { diff --git a/src/SimpleVersion.Core/Rules/ShortBranchNameTokenRule.cs b/src/SimpleVersion.Core/Rules/ShortBranchNameTokenRule.cs index 42244f9..bd6259a 100644 --- a/src/SimpleVersion.Core/Rules/ShortBranchNameTokenRule.cs +++ b/src/SimpleVersion.Core/Rules/ShortBranchNameTokenRule.cs @@ -1,7 +1,7 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. using System; -using SimpleVersion.Abstractions.Pipeline; +using SimpleVersion.Pipeline; namespace SimpleVersion.Rules { diff --git a/src/SimpleVersion.Core/Rules/ShortShaTokenRule.cs b/src/SimpleVersion.Core/Rules/ShortShaTokenRule.cs index ab9df5b..fb144a3 100644 --- a/src/SimpleVersion.Core/Rules/ShortShaTokenRule.cs +++ b/src/SimpleVersion.Core/Rules/ShortShaTokenRule.cs @@ -4,8 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; -using SimpleVersion.Abstractions.Pipeline; -using SimpleVersion.Abstractions.Rules; +using SimpleVersion.Pipeline; namespace SimpleVersion.Rules { diff --git a/src/SimpleVersion.Core/Rules/TokenRuleExtensions.cs b/src/SimpleVersion.Core/Rules/TokenRuleExtensions.cs index fc16abf..e017310 100644 --- a/src/SimpleVersion.Core/Rules/TokenRuleExtensions.cs +++ b/src/SimpleVersion.Core/Rules/TokenRuleExtensions.cs @@ -1,8 +1,6 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. using System.Collections.Generic; -using SimpleVersion.Abstractions.Pipeline; -using SimpleVersion.Abstractions.Rules; using SimpleVersion.Pipeline; namespace SimpleVersion.Rules diff --git a/src/SimpleVersion.Core/VersionCalculator.cs b/src/SimpleVersion.Core/VersionCalculator.cs index 5258e67..8ad82dd 100644 --- a/src/SimpleVersion.Core/VersionCalculator.cs +++ b/src/SimpleVersion.Core/VersionCalculator.cs @@ -3,8 +3,6 @@ using System; using System.IO; using LibGit2Sharp; -using SimpleVersion.Abstractions; -using SimpleVersion.Abstractions.Pipeline; using SimpleVersion.Model; using SimpleVersion.Pipeline; using SimpleVersion.Pipeline.Formatting; diff --git a/src/SimpleVersion.Core/VersioningEnvironment.cs b/src/SimpleVersion.Core/VersioningEnvironment.cs index faf2008..f57921b 100644 --- a/src/SimpleVersion.Core/VersioningEnvironment.cs +++ b/src/SimpleVersion.Core/VersioningEnvironment.cs @@ -1,7 +1,5 @@ // Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information. -using SimpleVersion.Abstractions; - namespace SimpleVersion { /// diff --git a/test/Directory.Build.props b/test/Directory.Build.props index c88d678..eea47ff 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -3,7 +3,7 @@ - netcoreapp3.0 + netcoreapp3.1 false $(NoWarn);SA0001 diff --git a/test/SimpleVersion.Abstractions.Tests/Exceptions/GitExceptionFixture.cs b/test/SimpleVersion.Abstractions.Tests/Exceptions/GitExceptionFixture.cs index 587d113..72c99dc 100644 --- a/test/SimpleVersion.Abstractions.Tests/Exceptions/GitExceptionFixture.cs +++ b/test/SimpleVersion.Abstractions.Tests/Exceptions/GitExceptionFixture.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; using FluentAssertions; -using SimpleVersion.Abstractions.Exceptions; +using SimpleVersion.Exceptions; using Xunit; namespace SimpleVersion.Abstractions.Tests.Exceptions @@ -45,7 +45,7 @@ public void Ctor_WithNullMessage_ShouldGiveDefault() var result = new GitException(null); // Assert - result.Message.Should().Be("Exception of type 'SimpleVersion.Abstractions.Exceptions.GitException' was thrown."); + result.Message.Should().Be("Exception of type 'SimpleVersion.Exceptions.GitException' was thrown."); } [Theory] diff --git a/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj b/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj index 124c6db..85b3947 100644 --- a/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj +++ b/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj @@ -2,7 +2,7 @@ - [SimpleVersion.Abstractions]* + true diff --git a/test/SimpleVersion.Core.Tests/Pipeline/AzureDevopsContextProcessorFixture.cs b/test/SimpleVersion.Core.Tests/Pipeline/AzureDevopsContextProcessorFixture.cs index 8eb18be..f024bc7 100644 --- a/test/SimpleVersion.Core.Tests/Pipeline/AzureDevopsContextProcessorFixture.cs +++ b/test/SimpleVersion.Core.Tests/Pipeline/AzureDevopsContextProcessorFixture.cs @@ -3,7 +3,6 @@ using FluentAssertions; using GitTools.Testing; using NSubstitute; -using SimpleVersion.Abstractions; using SimpleVersion.Pipeline; using Xunit; diff --git a/test/SimpleVersion.Core.Tests/Pipeline/VersionContextFixture.cs b/test/SimpleVersion.Core.Tests/Pipeline/VersionContextFixture.cs index a7fb79b..acf9f7a 100644 --- a/test/SimpleVersion.Core.Tests/Pipeline/VersionContextFixture.cs +++ b/test/SimpleVersion.Core.Tests/Pipeline/VersionContextFixture.cs @@ -3,7 +3,7 @@ using System; using FluentAssertions; using GitTools.Testing; -using SimpleVersion.Abstractions.Exceptions; +using SimpleVersion.Exceptions; using SimpleVersion.Pipeline; using Xunit; diff --git a/test/SimpleVersion.Core.Tests/Rules/TokenRuleExtensionsFixture.cs b/test/SimpleVersion.Core.Tests/Rules/TokenRuleExtensionsFixture.cs index 61e3c44..ca1ca5a 100644 --- a/test/SimpleVersion.Core.Tests/Rules/TokenRuleExtensionsFixture.cs +++ b/test/SimpleVersion.Core.Tests/Rules/TokenRuleExtensionsFixture.cs @@ -4,7 +4,6 @@ using System.Linq; using FluentAssertions; using NSubstitute; -using SimpleVersion.Abstractions.Rules; using SimpleVersion.Rules; using Xunit; From 92a3f6e1098283051f77780c40375565ef3a6f39 Mon Sep 17 00:00:00 2001 From: Kieranties Date: Tue, 17 Mar 2020 21:52:53 +0000 Subject: [PATCH 4/5] chore: Clean up usage of central package versions and coverlet --- .gitignore | 6 +----- Directory.Build.targets | 4 +++- .../SimpleVersion.Abstractions.csproj | 3 +-- src/SimpleVersion.Core/SimpleVersion.Core.csproj | 1 - src/SimpleVersion.Tool/SimpleVersion.Tool.csproj | 3 +-- .../SimpleVersion.Abstractions.Tests.csproj | 7 +------ .../SimpleVersion.Core.Tests.csproj | 7 +------ 7 files changed, 8 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 56d106d..3a7c1d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,5 @@ packages bin obj integration/temp -log.txt /docs/api/*.yml -/docs/api/.manifest -coverage.json -dotnet-install.ps1 -tools +/docs/api/.manifest \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index c09394e..e00090f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,7 @@ - + + + %(Filename).Generated.cs diff --git a/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj b/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj index 3550e53..3fab082 100644 --- a/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj +++ b/src/SimpleVersion.Abstractions/SimpleVersion.Abstractions.csproj @@ -1,9 +1,8 @@ - netstandard2.1 SimpleVersion - + diff --git a/src/SimpleVersion.Core/SimpleVersion.Core.csproj b/src/SimpleVersion.Core/SimpleVersion.Core.csproj index d8c5226..19e1a20 100644 --- a/src/SimpleVersion.Core/SimpleVersion.Core.csproj +++ b/src/SimpleVersion.Core/SimpleVersion.Core.csproj @@ -1,5 +1,4 @@ - netstandard2.1 diff --git a/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj b/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj index 743011e..b3278d8 100644 --- a/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj +++ b/src/SimpleVersion.Tool/SimpleVersion.Tool.csproj @@ -1,5 +1,4 @@ - netcoreapp3.1 @@ -11,5 +10,5 @@ - + diff --git a/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj b/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj index 85b3947..b13626d 100644 --- a/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj +++ b/test/SimpleVersion.Abstractions.Tests/SimpleVersion.Abstractions.Tests.csproj @@ -1,10 +1,5 @@ - - - - true - - + diff --git a/test/SimpleVersion.Core.Tests/SimpleVersion.Core.Tests.csproj b/test/SimpleVersion.Core.Tests/SimpleVersion.Core.Tests.csproj index 947e506..0f58c70 100644 --- a/test/SimpleVersion.Core.Tests/SimpleVersion.Core.Tests.csproj +++ b/test/SimpleVersion.Core.Tests/SimpleVersion.Core.Tests.csproj @@ -1,10 +1,5 @@ - - - - [SimpleVersion.Core]* - - + From 81b7962ca5f2675b7c13cbeb934c5c54e20b32f5 Mon Sep 17 00:00:00 2001 From: Kieranties Date: Tue, 17 Mar 2020 21:53:32 +0000 Subject: [PATCH 5/5] test