Skip to content

Commit fbe2087

Browse files
committed
refactor(Common): when gitversion.dll not found, throw FileNotFound and recommend running build.ps1 with "build,BuildPrepare"
1 parent 47c2f9d commit fbe2087

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

build/common/Lifetime/BuildLifetimeBase.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ public override void Setup(T context, ISetupContext info)
3030
context.Information("Running BuildPrepare...");
3131
return;
3232
}
33-
var gitVersionTool = context.GetGitVersionDotnetToolLocation();
3433
var gitVersionSettings = new GitVersionSettings
3534
{
3635
OutputTypes = new() { GitVersionOutput.Json, GitVersionOutput.BuildServer },
3736
ToolPath = context.Tools.Resolve(new[] { "dotnet.exe", "dotnet" }),
38-
ArgumentCustomization = args => args.Prepend(gitVersionTool!.FullPath)
37+
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\""))
3938
};
4039

4140
var gitVersion = context.GitVersion(gitVersionSettings);

0 commit comments

Comments
 (0)