Use common property for Git macros

This commit is contained in:
Julio C. Rocha 2024-05-10 14:39:40 -07:00
parent 9b55325429
commit cc4c58cd02
1 changed files with 9 additions and 9 deletions

View File

@ -19,31 +19,31 @@
<GetGitVersionSet>true</GetGitVersionSet> <GetGitVersionSet>true</GetGitVersionSet>
<GitVersion>$(GitRevisionShort)</GitVersion> <GitVersion>$(GitRevisionShort)</GitVersion>
<GitVersion Condition="'$(GitIsDirty)'!=''">$(GitRevisionShort)-Dirty</GitVersion> <GitVersion Condition="'$(GitIsDirty)'!=''">$(GitRevisionShort)-Dirty</GitVersion>
<GitPreprocessorDefinitions>
GIT_REVISION=$(GitRevision);
GIT_REVISION_SHORT=$(GitRevisionShort);
VERSION_BUILD=$(GitRevisionCount);
VERSION_BUILD_YEAR=$([System.DateTime]::Now.ToString(`yyyy`))
</GitPreprocessorDefinitions>
</PropertyGroup> </PropertyGroup>
<!-- TODO: Remove --> <!-- TODO: Remove -->
<Message Importance="High" Text="git rev: [$(GitRevision)]" /> <Message Importance="High" Text="git rev: [$(GitRevision)]" />
<Message Importance="High" Text="git rev short: [$(GitRevisionShort)]" /> <Message Importance="High" Text="git rev short: [$(GitRevisionShort)]" />
<Message Importance="High" Text="git rev count: [$(GitRevisionCount)]" /> <Message Importance="High" Text="git rev count: [$(GitRevisionCount)]" />
<Message Importance="High" Text="git dirty?: [Dirty]" Condition="'$(GitIsDirty)'!=''" /> <Message Importance="High" Text="git dirty?: [YES]" Condition="'$(GitIsDirty)'!=''" />
<Message Importance="High" Text="git dirty?: []" Condition="'$(GitIsDirty)'==''" /> <Message Importance="High" Text="git dirty?: []" Condition="'$(GitIsDirty)'==''" />
<Message Importance="High" Text="GitVersion: [$(GitVersion)]" /> <Message Importance="High" Text="GitVersion: [$(GitVersion)]" />
<ItemGroup> <ItemGroup>
<ClCompile> <ClCompile>
<PreprocessorDefinitions> <PreprocessorDefinitions>
%(PreprocessorDefinitions); %(PreprocessorDefinitions);
GIT_REVISION=$(GitRevision); $(GitPreprocessorDefinitions)
GIT_REVISION_SHORT=$(GitRevisionShort);
VERSION_BUILD=$(GitRevisionCount);
VERSION_BUILD_YEAR=$([System.DateTime]::Now.ToString(`yyyy`))
</PreprocessorDefinitions> </PreprocessorDefinitions>
</ClCompile> </ClCompile>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions> <PreprocessorDefinitions>
%(PreprocessorDefinitions); %(PreprocessorDefinitions);
GIT_REVISION=$(GitRevision); $(GitPreprocessorDefinitions)
GIT_REVISION_SHORT=$(GitRevisionShort);
VERSION_BUILD=$(GitRevisionCount);
VERSION_BUILD_YEAR=$([System.DateTime]::Now.ToString(`yyyy`))
</PreprocessorDefinitions> </PreprocessorDefinitions>
</ResourceCompile> </ResourceCompile>
</ItemGroup> </ItemGroup>