Skip to content

Commit

Permalink
refactor(Common): when gitversion.dll not found, throw FileNotFound a…
Browse files Browse the repository at this point in the history
…nd recommend running build.ps1 with "build,BuildPrepare"
  • Loading branch information
BinToss committed Nov 18, 2023
1 parent 47c2f9d commit fbe2087
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions build/common/Lifetime/BuildLifetimeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ public override void Setup(T context, ISetupContext info)
context.Information("Running BuildPrepare...");
return;
}
var gitVersionTool = context.GetGitVersionDotnetToolLocation();
var gitVersionSettings = new GitVersionSettings
{
OutputTypes = new() { GitVersionOutput.Json, GitVersionOutput.BuildServer },
ToolPath = context.Tools.Resolve(new[] { "dotnet.exe", "dotnet" }),
ArgumentCustomization = args => args.Prepend(gitVersionTool!.FullPath)
ArgumentCustomization = args => args.Prepend(context.GetGitVersionDotnetToolLocation()?.FullPath ?? throw new FileNotFoundException("Failed to locate the Release build of gitversion.dll in ./tools/gitversion. Try running \"./build.ps1 -Stage build -Target BuildPrepare\""))
};

var gitVersion = context.GitVersion(gitVersionSettings);
Expand Down

0 comments on commit fbe2087

Please sign in to comment.