Define GetGitVersion target
This commit is contained in:
parent
3cdd8ce0ff
commit
7ce6ca7110
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
|
||||
<Target Name="GetGitVersion" BeforeTargets="PrepareForBuild" Condition="'$(NeedsVersioning)'=='true'">
|
||||
<Exec Command="git rev-parse HEAD" ConsoleToMsBuild="true" StandardOutputImportance="Low" EchoOff="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitRevision" />
|
||||
</Exec>
|
||||
<Exec Command="git rev-parse --short HEAD" ConsoleToMsBuild="true" StandardOutputImportance="Low" EchoOff="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitRevisionShort" />
|
||||
</Exec>
|
||||
<Exec Command="git rev-list --count HEAD" ConsoleToMsBuild="true" StandardOutputImportance="Low" EchoOff="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitRevisionCount" />
|
||||
</Exec>
|
||||
<!-- TODO: Remove -->
|
||||
<Message Importance="High" Text="git rev: [$(GitRevision)]" />
|
||||
<Message Importance="High" Text="git rev short: [$(GitRevisionShort)]" />
|
||||
<Message Importance="High" Text="git rev count: [$(GitRevisionCount)]" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
|
@ -24,6 +24,7 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<NeedsVersioning>true</NeedsVersioning>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
|
@ -33,7 +34,7 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ItemDefinitionGroup>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(SolutionDir)Source\Script\UpdateVersion.cmd" "$(Configuration)" "$(Platform)" "$(SolutionDir)Source\Project64-rsp-core\Version.h.in" "$(SolutionDir)Source\Project64-rsp-core\Version.h"</Command>
|
||||
<!-- <Command>"$(SolutionDir)Source\Script\UpdateVersion.cmd" "$(Configuration)" "$(Platform)" "$(SolutionDir)Source\Project64-rsp-core\Version.h.in" "$(SolutionDir)Source\Project64-rsp-core\Version.h"</Command> -->
|
||||
</PreBuildEvent>
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
|
|
Loading…
Reference in New Issue