Skip to content

Commit 720d23a

Browse files
committed
(build) caching GitVersion.dll from one stage to another
1 parent e7fc0b7 commit 720d23a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build/utils/utils.cake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ void SetRubyGemPushApiKey(string apiKey)
3636

3737
GitVersion GetVersion(BuildParameters parameters)
3838
{
39-
Build(parameters.Configuration);
40-
var dllFile = GetFiles($"**/GitVersionExe/bin/{parameters.Configuration}/{parameters.CoreFxVersion}/GitVersion.dll").FirstOrDefault();
39+
var dllFilePath = $"./artifacts/*/bin/{parameters.CoreFxVersion}/tools/GitVersion.dll";
40+
var dllFile = GetFiles(dllFilePath).FirstOrDefault();
41+
if (dllFile == null)
42+
{
43+
Warning("Dogfood GitVersion to get information");
44+
Build(parameters.Configuration);
45+
dllFilePath = $"./src/GitVersionExe/bin/{parameters.Configuration}/{parameters.CoreFxVersion}/GitVersion.dll";
46+
dllFile = GetFiles(dllFilePath).FirstOrDefault();
47+
}
48+
4149
var settings = new GitVersionSettings
4250
{
4351
OutputType = GitVersionOutput.Json,

0 commit comments

Comments
 (0)