Skip to content

Commit 8dbdccc

Browse files
committed
Don't run GitVersion on Unix, due to GitTools/GitVersion#890 and cake-build/cake#1021.
1 parent 3bce24b commit 8dbdccc

File tree

1 file changed

+39
-37
lines changed

1 file changed

+39
-37
lines changed

build.cake

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,45 +50,47 @@ Task("NuGet-Package-Restore")
5050

5151
Setup(context =>
5252
{
53-
var settings = new GitVersionSettings
53+
if (IsRunningOnWindows)
5454
{
55-
OutputType = GitVersionOutput.Json,
56-
LogFilePath = "console"
57-
};
55+
var settings = new GitVersionSettings
56+
{
57+
OutputType = GitVersionOutput.Json,
58+
};
5859

59-
/*if (!BuildSystem.IsLocalBuild)
60-
{
61-
settings.LogFilePath = "console";
62-
settings.OutputType = GitVersionOutput.BuildServer;
63-
}*/
64-
65-
var gitVersion = GitVersion(settings);
66-
67-
Information("AssemblySemVer: " + gitVersion.AssemblySemVer);
68-
Information("BranchName: " + gitVersion.BranchName);
69-
Information("BuildMetaData: " + gitVersion.BuildMetaData);
70-
Information("BuildMetaDataPadded: " + gitVersion.BuildMetaDataPadded);
71-
Information("CommitDate: " + gitVersion.CommitDate);
72-
Information("CommitsSinceVersionSource: " + gitVersion.CommitsSinceVersionSource);
73-
Information("CommitsSinceVersionSourcePadded: " + gitVersion.CommitsSinceVersionSourcePadded);
74-
Information("FullBuildMetaData: " + gitVersion.FullBuildMetaData);
75-
Information("FullSemVer: " + gitVersion.FullSemVer);
76-
Information("InformationalVersion: " + gitVersion.InformationalVersion);
77-
Information("LegacySemVer: " + gitVersion.LegacySemVer);
78-
Information("LegacySemVerPadded: " + gitVersion.LegacySemVerPadded);
79-
Information("Major: " + gitVersion.Major);
80-
Information("Minor: " + gitVersion.Minor);
81-
Information("NuGetVersion: " + gitVersion.NuGetVersion);
82-
Information("NuGetVersionV2: " + gitVersion.NuGetVersionV2);
83-
Information("Patch: " + gitVersion.Patch);
84-
Information("PreReleaseLabel: " + gitVersion.PreReleaseLabel);
85-
Information("PreReleaseNumber: " + gitVersion.PreReleaseNumber);
86-
Information("PreReleaseTag: " + gitVersion.PreReleaseTag);
87-
Information("PreReleaseTagWithDash: " + gitVersion.PreReleaseTagWithDash);
88-
Information("SemVer: " + gitVersion.SemVer);
89-
Information("Sha: " + gitVersion.Sha);
90-
91-
packageVersion = gitVersion.NuGetVersion ?? context.EnvironmentVariable("GitVersion_NuGetVersion");
60+
/*if (!BuildSystem.IsLocalBuild)
61+
{
62+
settings.LogFilePath = "console";
63+
settings.OutputType = GitVersionOutput.BuildServer;
64+
}*/
65+
66+
var gitVersion = GitVersion(settings);
67+
68+
Information("AssemblySemVer: " + gitVersion.AssemblySemVer);
69+
Information("BranchName: " + gitVersion.BranchName);
70+
Information("BuildMetaData: " + gitVersion.BuildMetaData);
71+
Information("BuildMetaDataPadded: " + gitVersion.BuildMetaDataPadded);
72+
Information("CommitDate: " + gitVersion.CommitDate);
73+
Information("CommitsSinceVersionSource: " + gitVersion.CommitsSinceVersionSource);
74+
Information("CommitsSinceVersionSourcePadded: " + gitVersion.CommitsSinceVersionSourcePadded);
75+
Information("FullBuildMetaData: " + gitVersion.FullBuildMetaData);
76+
Information("FullSemVer: " + gitVersion.FullSemVer);
77+
Information("InformationalVersion: " + gitVersion.InformationalVersion);
78+
Information("LegacySemVer: " + gitVersion.LegacySemVer);
79+
Information("LegacySemVerPadded: " + gitVersion.LegacySemVerPadded);
80+
Information("Major: " + gitVersion.Major);
81+
Information("Minor: " + gitVersion.Minor);
82+
Information("NuGetVersion: " + gitVersion.NuGetVersion);
83+
Information("NuGetVersionV2: " + gitVersion.NuGetVersionV2);
84+
Information("Patch: " + gitVersion.Patch);
85+
Information("PreReleaseLabel: " + gitVersion.PreReleaseLabel);
86+
Information("PreReleaseNumber: " + gitVersion.PreReleaseNumber);
87+
Information("PreReleaseTag: " + gitVersion.PreReleaseTag);
88+
Information("PreReleaseTagWithDash: " + gitVersion.PreReleaseTagWithDash);
89+
Information("SemVer: " + gitVersion.SemVer);
90+
Information("Sha: " + gitVersion.Sha);
91+
92+
packageVersion = gitVersion.NuGetVersion ?? context.EnvironmentVariable("GitVersion_NuGetVersion");
93+
}
9294

9395
if (string.IsNullOrWhiteSpace(packageVersion))
9496
{

0 commit comments

Comments
 (0)