Skip to content
Permalink
Browse files

[Build] NuGetVersion reported to TeamCity was wrong

  • Loading branch information
xen2 committed Jan 28, 2019
1 parent 55092e2 commit fd5c4b0eff9ce683ba09b51e0e91c28667514d10
Showing with 5 additions and 2 deletions.
  1. +5 −2 deps/Xenko.GitVersioning/GenerateVersionFile.cs
@@ -67,10 +67,13 @@ public override bool Execute()
var versionFileData = File.ReadAllText(Path.Combine(RootDirectory.ItemSpec, VersionFile.ItemSpec));

var publicVersionMatch = Regex.Match(versionFileData, "PublicVersion = \"(.*)\";");
var versionSuffixMatch = Regex.Match(versionFileData, "NuGetVersionSuffix = \"(.*)\";");
var publicVersion = publicVersionMatch.Success ? publicVersionMatch.Groups[1].Value : "0.0.0.0";
var versionSuffix = versionSuffixMatch.Success ? versionSuffixMatch.Groups[1].Value : string.Empty;

// Patch NuGetVersion
var versionSuffix = SpecialVersion ?? string.Empty;
if (SpecialVersion != null)
versionSuffix += SpecialVersion;

EnsureLibGit2UnmanagedInPath(mainPlatformDirectory);

@@ -98,7 +101,7 @@ public override bool Execute()
}

// Replace NuGetVersionSuffix
versionFileData = Regex.Replace(versionFileData, "NuGetVersionSuffix = \"(.*)\";", $"NuGetVersionSuffix = \"$1{versionSuffix}\";");
versionFileData = Regex.Replace(versionFileData, "NuGetVersionSuffix = \"(.*)\";", $"NuGetVersionSuffix = \"{versionSuffix}\";");

// Always include git commit (even if not part of NuGetVersionSuffix)
if (SpecialVersionGitCommit && headCommitSha != null)

0 comments on commit fd5c4b0

Please sign in to comment.
You can’t perform that action at this time.