Skip to content

Commit

Permalink
Merge pull request #28 from AArnott/fix25
Browse files Browse the repository at this point in the history
Append git commit ID to all NuGet packages
  • Loading branch information
AArnott committed Oct 5, 2015
2 parents 97e4f88 + 3ad8cf0 commit b536b5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/NerdBank.GitVersioning.Tests/BuildIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ public async Task GetBuildVersion_StablePreRelease()
this.AddCommits(this.random.Next(15));
var buildResult = await this.BuildAsync();
this.AssertStandardProperties(VersionOptions.FromVersion(new Version(majorMinorVersion)), buildResult);

Version version = this.Repo.Head.Commits.First().GetIdAsVersion();
Assert.Equal($"{version.Major}.{version.Minor}.{buildResult.GitHeight}", buildResult.NuGetPackageVersion);
}

[Fact]
Expand Down Expand Up @@ -233,7 +230,7 @@ private void AssertStandardProperties(VersionOptions versionOptions, BuildResult
Assert.Equal(versionOptions.Version.Prerelease, buildResult.PrereleaseVersion);
Assert.Equal($"+g{commitIdShort}", buildResult.SemVerBuildSuffix);

string pkgVersionSuffix = (buildResult.PublicRelease || string.IsNullOrEmpty(versionOptions.Version.Prerelease))
string pkgVersionSuffix = buildResult.PublicRelease
? string.Empty
: $"-g{commitIdShort}";
Assert.Equal($"{idAsVersion.Major}.{idAsVersion.Minor}.{idAsVersion.Build}{versionOptions.Version.Prerelease}{pkgVersionSuffix}", buildResult.NuGetPackageVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<!-- For unreleased versions (not expected to follow linear history), append the git commit id.
The 'g' prefix allows tooling to recognize that a git commit ID follows. -->
<NuGetPackageVersion Condition=" '$(PublicRelease)' != 'true' and '$(PrereleaseVersion)' != '' ">$(NuGetPackageVersion)-g$(GitCommitIdShort)</NuGetPackageVersion>
<NuGetPackageVersion Condition=" '$(PublicRelease)' != 'true' ">$(NuGetPackageVersion)-g$(GitCommitIdShort)</NuGetPackageVersion>
</PropertyGroup>

<Warning Condition=" '$(AssemblyInformationalVersion)' == '' " Text="Unable to determine the git HEAD commit ID to use for informational version number." />
Expand Down

0 comments on commit b536b5f

Please sign in to comment.