diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 23e1c931b4e..e10fefa8d6a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -7,6 +7,12 @@ "commands": [ "dotnet-cake" ] + }, + "GitVersion.Tool": { + "version": "5.11.1", + "commands": [ + "dotnet-gitversion" + ] } } } diff --git a/build.cake b/build.cake index e57fbb57a51..815a15d5ad9 100644 --- a/build.cake +++ b/build.cake @@ -9,7 +9,6 @@ var configuration = Argument("configuration", "Release"); // EXTERNAL NUGET TOOLS ////////////////////////////////////////////////////////////////////// -#Tool "GitVersion.CommandLine&version=5.11.1" #Tool "xunit.runner.console&version=2.4.2" ////////////////////////////////////////////////////////////////////// @@ -113,12 +112,13 @@ Task("__UpdateAssemblyVersionInformation") .Does(() => { var gitVersionSettings = new ProcessSettings() - .SetRedirectStandardOutput(true); + .SetRedirectStandardOutput(true) + .WithArguments(args => args.Append("gitversion")); try { IEnumerable outputLines; - StartProcess(gitVersionPath, gitVersionSettings, out outputLines); + StartProcess("dotnet", gitVersionSettings, out outputLines); var output = string.Join("\n", outputLines); gitVersionOutput = Newtonsoft.Json.JsonConvert.DeserializeObject>(output); diff --git a/build.ps1 b/build.ps1 index 45a10c20c7d..78481433871 100755 --- a/build.ps1 +++ b/build.ps1 @@ -69,7 +69,7 @@ if (-Not $SkipToolPackageRestore.IsPresent) Write-Verbose -Message "Restoring tools from NuGet..." - $NuGetOutput = Invoke-Expression "& dotnet tool install Cake.Tool --version 3.0.0" + $NuGetOutput = Invoke-Expression "& dotnet tool restore" Write-Verbose ($NuGetOutput | Out-String) Pop-Location