Skip to content

Commit

Permalink
Improve versioning of sample package
Browse files Browse the repository at this point in the history
42.[days-since-epoc].[day-seconds]

This makes it ever-incrementing automatically.
  • Loading branch information
kzu committed Jun 18, 2024
1 parent 55124bc commit 3b943f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/SponsorLink/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

<!-- Roslyn caches analyzers aggressively so we are better off using a very dynamic version number
for local builds where a quick devloop is key. We bump version every 10 seconds -->
<Version>42.42.$([System.Math]::Floor($([MSBuild]::Divide($([System.DateTime]::Now.TimeOfDay.TotalSeconds), 10))))</Version>
<Epoc>$([System.DateTime]::Parse("2024-03-15"))</Epoc>
<TotalDays>$([System.DateTime]::UtcNow.Subtract($(Epoc)).TotalDays)</TotalDays>
<Days>$([System.Math]::Truncate($(TotalDays)))</Days>
<Seconds>$([System.Math]::Floor($([MSBuild]::Divide($([System.DateTime]::UtcNow.TimeOfDay.TotalSeconds), 10))))</Seconds>
<Version>42.$(Days).$(Seconds)</Version>

<Product>SponsorableLib</Product>
</PropertyGroup>
Expand Down

0 comments on commit 3b943f5

Please sign in to comment.