-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify IsDirty with newer typed constants in ThisAssembly
We don't need the generator anymore, since the typed boolean is supported natively by the ThisAssembly.Constants dependency.
- Loading branch information
Showing
5 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project InitialTargets="SetLocalVersion"> | ||
|
||
<Target Name="SetLocalVersion" Condition="!$(CI)"> | ||
<GetVersion> | ||
<Output TaskParameter="Version" PropertyName="Version" /> | ||
</GetVersion> | ||
</Target> | ||
|
||
<UsingTask TaskName="GetVersion" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"> | ||
<ParameterGroup> | ||
<Version Output="true" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Using Namespace="System" /> | ||
<Using Namespace="Microsoft.Build.Framework"/> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
var version = this.BuildEngine4.GetRegisteredTaskObject("Version", RegisteredTaskObjectLifetime.Build); | ||
if (version == null) | ||
{ | ||
var epoc = DateTime.Parse("2024-03-15"); | ||
var days = Math.Truncate(DateTime.UtcNow.Subtract(epoc).TotalDays); | ||
var time = Math.Floor(DateTime.UtcNow.TimeOfDay.TotalMinutes); | ||
version = "42." + days + "." + time; | ||
this.BuildEngine4.RegisterTaskObject("Version", version, RegisteredTaskObjectLifetime.Build, false); | ||
} | ||
Version = (string)version; | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters