Skip to content

Commit

Permalink
Merge pull request #1107 from MattKotsenas/bugfix/1067-rebuild-package
Browse files Browse the repository at this point in the history
Ensure GetBuildVersion runs before Clean
  • Loading branch information
AArnott authored Oct 17, 2024
2 parents 41ee52c + d2e7eee commit 62dbaa6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
$(VersionDependsOn)
</VersionDependsOn>

<CleanDependsOn>
GetBuildVersion;
$(CleanDependsOn)
</CleanDependsOn>

<GenerateNuspecDependsOn>
GetBuildVersion;
$(GenerateNuspecDependsOn)
Expand Down
8 changes: 8 additions & 0 deletions test/Nerdbank.GitVersioning.Tests/BuildIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ public async Task GetBuildVersion_Without_Git()
Assert.Equal("3.4.0", buildResult.AssemblyInformationalVersion);
}

[Fact]
public async Task GetBuildVersion_Hooks_Clean()
{
this.WriteVersionFile("1.2");
BuildResults buildResult = await this.BuildAsync("Clean");
Assert.Equal("1.2", buildResult.BuildVersion);
}

[Fact]
public async Task GetBuildVersion_Without_Git_HighPrecisionAssemblyVersion()
{
Expand Down

0 comments on commit 62dbaa6

Please sign in to comment.