Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Update CommonAssemblyInfo for CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
CharliePoole committed Sep 7, 2017
1 parent a0ef16a commit d9606c0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
23 changes: 15 additions & 8 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,25 @@ Task("RestorePackages")
Task("SetBuildInfo")
.Does(() =>
{
GitVersionInfo = GitVersion();
Information("GitVersion Info:\n" + GitVersionInfo.Dump());
var settings = new GitVersionSettings();
if (!BuildSystem.IsLocalBuild)
{
settings.UpdateAssemblyInfo = true;
settings.UpdateAssemblyInfoFilePath = "src/CommonAssemblyInfo.cs";
}

GitVersionInfo = GitVersion(settings);
Build = new BuildInfo(GitVersionInfo);

// Debug info for testing GitVersion
Information("GitVersion Info:\n" + GitVersionInfo.Dump());
Information("\nBuildInfo:\n" + Build.Dump());

if (BuildSystem.IsRunningOnAppVeyor)
{
string version = "0.6.0";
string dbgSuffix = configuration == "Debug" ? "-dbg" : "";
string packageVersion = version + dbgSuffix;
string version = "0.6.0";
string dbgSuffix = configuration == "Debug" ? "-dbg" : "";
string packageVersion = version + dbgSuffix;
var tag = AppVeyor.Environment.Repository.Tag;

if (tag.IsTag)
Expand Down Expand Up @@ -117,9 +125,8 @@ Task("SetBuildInfo")
}

Information("\nOld PackageVersion would be " + packageVersion + " on AppVeyor\n");

AppVeyor.UpdateBuildVersion(Build.PackageVersion);
}
// End of debug info
});

//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -317,7 +324,7 @@ Task("Appveyor")

Task("Travis")
.IsDependentOn("Build")
.IsDependentOn("PackageZip");
.IsDependentOn("PackageZip");

Task("Default")
.IsDependentOn("Build");
Expand Down
3 changes: 2 additions & 1 deletion src/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// Common version information for all assemblies.
// Common version information for local developer builds.
// Should be set to the NEXT planned version between releases.
// For CI builds, this info will be updated by GitVersion.
[assembly: AssemblyVersion("0.6.0.0")]
[assembly: AssemblyFileVersion("0.6.0.0")]

0 comments on commit d9606c0

Please sign in to comment.