Skip to content

Commit 3b943f5

Browse files
committed
Improve versioning of sample package
42.[days-since-epoc].[day-seconds] This makes it ever-incrementing automatically.
1 parent 55124bc commit 3b943f5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/SponsorLink/Directory.Build.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

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

2024
<Product>SponsorableLib</Product>
2125
</PropertyGroup>

0 commit comments

Comments
 (0)