Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
Don't run GitVersion on Unix, due to GitTools/GitVersion#890 and cake…
Browse files Browse the repository at this point in the history
  • Loading branch information
asbjornu committed Jun 30, 2016
1 parent 3bce24b commit 8dbdccc
Showing 1 changed file with 39 additions and 37 deletions.
76 changes: 39 additions & 37 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -50,45 +50,47 @@ Task("NuGet-Package-Restore")

Setup(context =>
{
var settings = new GitVersionSettings
if (IsRunningOnWindows)
{
OutputType = GitVersionOutput.Json,
LogFilePath = "console"
};
var settings = new GitVersionSettings
{
OutputType = GitVersionOutput.Json,
};

/*if (!BuildSystem.IsLocalBuild)
{
settings.LogFilePath = "console";
settings.OutputType = GitVersionOutput.BuildServer;
}*/

var gitVersion = GitVersion(settings);

Information("AssemblySemVer: " + gitVersion.AssemblySemVer);
Information("BranchName: " + gitVersion.BranchName);
Information("BuildMetaData: " + gitVersion.BuildMetaData);
Information("BuildMetaDataPadded: " + gitVersion.BuildMetaDataPadded);
Information("CommitDate: " + gitVersion.CommitDate);
Information("CommitsSinceVersionSource: " + gitVersion.CommitsSinceVersionSource);
Information("CommitsSinceVersionSourcePadded: " + gitVersion.CommitsSinceVersionSourcePadded);
Information("FullBuildMetaData: " + gitVersion.FullBuildMetaData);
Information("FullSemVer: " + gitVersion.FullSemVer);
Information("InformationalVersion: " + gitVersion.InformationalVersion);
Information("LegacySemVer: " + gitVersion.LegacySemVer);
Information("LegacySemVerPadded: " + gitVersion.LegacySemVerPadded);
Information("Major: " + gitVersion.Major);
Information("Minor: " + gitVersion.Minor);
Information("NuGetVersion: " + gitVersion.NuGetVersion);
Information("NuGetVersionV2: " + gitVersion.NuGetVersionV2);
Information("Patch: " + gitVersion.Patch);
Information("PreReleaseLabel: " + gitVersion.PreReleaseLabel);
Information("PreReleaseNumber: " + gitVersion.PreReleaseNumber);
Information("PreReleaseTag: " + gitVersion.PreReleaseTag);
Information("PreReleaseTagWithDash: " + gitVersion.PreReleaseTagWithDash);
Information("SemVer: " + gitVersion.SemVer);
Information("Sha: " + gitVersion.Sha);

packageVersion = gitVersion.NuGetVersion ?? context.EnvironmentVariable("GitVersion_NuGetVersion");
/*if (!BuildSystem.IsLocalBuild)
{
settings.LogFilePath = "console";
settings.OutputType = GitVersionOutput.BuildServer;
}*/

var gitVersion = GitVersion(settings);

Information("AssemblySemVer: " + gitVersion.AssemblySemVer);
Information("BranchName: " + gitVersion.BranchName);
Information("BuildMetaData: " + gitVersion.BuildMetaData);
Information("BuildMetaDataPadded: " + gitVersion.BuildMetaDataPadded);
Information("CommitDate: " + gitVersion.CommitDate);
Information("CommitsSinceVersionSource: " + gitVersion.CommitsSinceVersionSource);
Information("CommitsSinceVersionSourcePadded: " + gitVersion.CommitsSinceVersionSourcePadded);
Information("FullBuildMetaData: " + gitVersion.FullBuildMetaData);
Information("FullSemVer: " + gitVersion.FullSemVer);
Information("InformationalVersion: " + gitVersion.InformationalVersion);
Information("LegacySemVer: " + gitVersion.LegacySemVer);
Information("LegacySemVerPadded: " + gitVersion.LegacySemVerPadded);
Information("Major: " + gitVersion.Major);
Information("Minor: " + gitVersion.Minor);
Information("NuGetVersion: " + gitVersion.NuGetVersion);
Information("NuGetVersionV2: " + gitVersion.NuGetVersionV2);
Information("Patch: " + gitVersion.Patch);
Information("PreReleaseLabel: " + gitVersion.PreReleaseLabel);
Information("PreReleaseNumber: " + gitVersion.PreReleaseNumber);
Information("PreReleaseTag: " + gitVersion.PreReleaseTag);
Information("PreReleaseTagWithDash: " + gitVersion.PreReleaseTagWithDash);
Information("SemVer: " + gitVersion.SemVer);
Information("Sha: " + gitVersion.Sha);

packageVersion = gitVersion.NuGetVersion ?? context.EnvironmentVariable("GitVersion_NuGetVersion");
}

if (string.IsNullOrWhiteSpace(packageVersion))
{
Expand Down

0 comments on commit 8dbdccc

Please sign in to comment.