implement automatic versioning based on git status
If the current commit has a tag, the version string will be "Cxbx-Reloaded TAG_NAME (DATE) If the current commit does not have a tag, the version string will be "Cxbx-Reloaded COMMIT_SHORT_HASH (DATE)"
This commit is contained in:
parent
f4621c934c
commit
cfaae52f53
|
@ -76,3 +76,4 @@ packages/
|
|||
|
||||
#Test files
|
||||
*.testsettings
|
||||
src/Version.h
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
@ECHO OFF
|
||||
SET GIT_VERSION=
|
||||
git describe --always > GIT_VERSION
|
||||
for /f "delims=" %%x in (GIT_VERSION) do set GIT_VERSION=%%x
|
||||
ECHO #define _GIT_VERSION "%GIT_VERSION%" > "%~1"
|
||||
del GIT_VERSION
|
|
@ -55,6 +55,18 @@
|
|||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\import\DirectX8\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\import\DirectX8\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<CustomBuildBeforeTargets>
|
||||
</CustomBuildBeforeTargets>
|
||||
<CustomBuildAfterTargets>
|
||||
</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<CustomBuildBeforeTargets>
|
||||
</CustomBuildBeforeTargets>
|
||||
<CustomBuildAfterTargets>
|
||||
</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -100,6 +112,22 @@
|
|||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep>
|
||||
<Outputs>
|
||||
</Outputs>
|
||||
<TreatOutputAsContent>
|
||||
</TreatOutputAsContent>
|
||||
</CustomBuildStep>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)Version.bat $(SolutionDir)..\..\src\Version.h</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Build Version.ini</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
|
@ -149,6 +177,22 @@
|
|||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep>
|
||||
<Outputs>
|
||||
</Outputs>
|
||||
<TreatOutputAsContent>
|
||||
</TreatOutputAsContent>
|
||||
</CustomBuildStep>
|
||||
<PreBuildEvent>
|
||||
<Command>$(SolutionDir)Version.bat $(SolutionDir)..\..\src\Version.h</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Build Version.ini</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\Common\Win32\AlignPosfix1.h" />
|
||||
|
|
|
@ -82,11 +82,13 @@ typedef signed long sint32;
|
|||
/*! define this to dump textures that are registered */
|
||||
//#define _DEBUG_DUMP_TEXTURE_REGISTER "D:\\cxbx\\_textures\\"
|
||||
|
||||
#include "Version.h"
|
||||
|
||||
/*! version string dependent on trace flag */
|
||||
#ifndef _DEBUG_TRACE
|
||||
#define _CXBX_VERSION "0.0.1-POC"
|
||||
#define _CXBX_VERSION _GIT_VERSION " ("__DATE__ ")"
|
||||
#else
|
||||
#define _CXBX_VERSION "0.0.1-POC-Trace"
|
||||
#define _CXBX_VERSION _GIT_VERSION "-Trace ("__DATE__ ")"
|
||||
#endif
|
||||
|
||||
/*! debug mode choices */
|
||||
|
|
Loading…
Reference in New Issue