From 0fdac1bdc260d89fe6f6514e98c594ce3bbbfcb1 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Sun, 11 Nov 2018 19:32:27 +0200 Subject: [PATCH] Publish as .NET Core Global Tool --- build.cake | 3 ++- build/parameters.cake | 3 ++- src/GitVersion.sln | 6 ++++++ src/GitVersionExe/Directory.Build.props | 5 +++++ src/GitVersionExe/GitVersion.Tool.csproj | 11 +++++++++++ 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/GitVersionExe/Directory.Build.props create mode 100644 src/GitVersionExe/GitVersion.Tool.csproj diff --git a/build.cake b/build.cake index 6a43638718..a90ad71f0e 100644 --- a/build.cake +++ b/build.cake @@ -335,9 +335,10 @@ Task("Pack-Nuget") MSBuildSettings = parameters.MSBuildSettings }; - // GitVersionCore & GitVersionTask + // GitVersionCore, GitVersionTask, & global tool DotNetCorePack("./src/GitVersionCore", settings); DotNetCorePack("./src/GitVersionTask", settings); + DotNetCorePack("./src/GitVersionExe/GitVersion.Tool.csproj", settings); }); Task("Pack-Chocolatey") diff --git a/build/parameters.cake b/build/parameters.cake index 69df85e126..1888ad14c8 100644 --- a/build/parameters.cake +++ b/build/parameters.cake @@ -94,7 +94,7 @@ public class BuildParameters Packages = BuildPackages.GetPackages( Paths.Directories.NugetRoot, Version.SemVersion, - new [] { "GitVersion.CommandLine.DotNetCore", "GitVersion.CommandLine", "GitVersionCore", "GitVersionTask" }, + new [] { "GitVersion.CommandLine.DotNetCore", "GitVersion.CommandLine", "GitVersionCore", "GitVersionTask", "GitVersion.Tool" }, new [] { "GitVersion.Portable" }); var files = Paths.Files; @@ -113,6 +113,7 @@ public class BuildParameters ["GitVersion.CommandLine.DotNetCore"] = Paths.Directories.ArtifactsBinNetCore, ["GitVersion.CommandLine"] = Paths.Directories.ArtifactsBinFullFxCmdline, ["GitVersion.Portable"] = Paths.Directories.ArtifactsBinFullFxPortable, + ["GitVersion.Tool"] = Paths.Directories.ArtifactsBinNetCore, }; Credentials = BuildCredentials.GetCredentials(context); diff --git a/src/GitVersion.sln b/src/GitVersion.sln index 007ddbb819..d328c1b09c 100644 --- a/src/GitVersion.sln +++ b/src/GitVersion.sln @@ -69,6 +69,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DockerBase", "DockerBase", Docker\Mono\DockerBase\readme = Docker\Mono\DockerBase\readme EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Tool", "GitVersionExe\GitVersion.Tool.csproj", "{929263FD-5CD2-42E1-BF3D-E0C1B0320DA4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -99,6 +101,10 @@ Global {F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|Any CPU.Build.0 = Release|Any CPU + {929263FD-5CD2-42E1-BF3D-E0C1B0320DA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {929263FD-5CD2-42E1-BF3D-E0C1B0320DA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {929263FD-5CD2-42E1-BF3D-E0C1B0320DA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {929263FD-5CD2-42E1-BF3D-E0C1B0320DA4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/GitVersionExe/Directory.Build.props b/src/GitVersionExe/Directory.Build.props new file mode 100644 index 0000000000..8a293f7713 --- /dev/null +++ b/src/GitVersionExe/Directory.Build.props @@ -0,0 +1,5 @@ + + + $(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\ + + diff --git a/src/GitVersionExe/GitVersion.Tool.csproj b/src/GitVersionExe/GitVersion.Tool.csproj new file mode 100644 index 0000000000..8ff2e6aabb --- /dev/null +++ b/src/GitVersionExe/GitVersion.Tool.csproj @@ -0,0 +1,11 @@ + + + + + true + netcoreapp2.1 + dotnet-gitversion + GitVersion.Tool + + +