Implemented auto-incrementing project version numbers.
This commit is contained in:
parent
d099bdde84
commit
26aeb8d440
@ -5,6 +5,7 @@
|
||||
#include "Bullet.h"
|
||||
#include "Ability.h"
|
||||
#include "Class.h"
|
||||
#include "Version.h"
|
||||
#include "DEFINES.h"
|
||||
|
||||
//192x192
|
||||
@ -684,6 +685,9 @@ void Crawler::RenderHud(){
|
||||
}
|
||||
}
|
||||
DrawStringPropDecal({20,3},text,WHITE,{2,2});
|
||||
std::string versionStr("v" + std::to_string(VERSION_MAJOR) + "." + std::to_string(VERSION_MINOR) + "." + std::to_string(VERSION_PATCH) + "." + std::to_string(VERSION_BUILD));
|
||||
DrawStringDecal(vf2d{ GetScreenSize() } - vf2d{ GetTextSize(versionStr) }*0.6 - vf2d{ -1,0 }, versionStr, WHITE, { 0.6,0.6 });
|
||||
DrawStringDecal(vf2d{ GetScreenSize() } - vf2d{ GetTextSize(versionStr) }*0.6, versionStr, BLACK,{0.6,0.6});
|
||||
}
|
||||
|
||||
void Crawler::AddEffect(Effect foreground,Effect background){
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
// ... other stuff
|
||||
#include "resource.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United States) resources
|
||||
|
@ -81,6 +81,9 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
@ -97,6 +100,9 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
@ -110,6 +116,9 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
@ -127,6 +136,9 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Ability.h" />
|
||||
@ -147,6 +159,7 @@
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="resource1.h" />
|
||||
<ClInclude Include="State.h" />
|
||||
<ClInclude Include="Version.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Ability.cpp" />
|
||||
|
@ -72,6 +72,9 @@
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Version.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Player.cpp">
|
||||
|
5
Crawler/Version.h
Normal file
5
Crawler/Version.h
Normal file
@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 10
|
10
Crawler/update_version.ps1
Normal file
10
Crawler/update_version.ps1
Normal file
@ -0,0 +1,10 @@
|
||||
(Get-Content -path $args[0] -Raw) |
|
||||
ForEach-Object {
|
||||
$defstr="#define VERSION_BUILD ";
|
||||
$regex="$defstr(?<BuildVersion>\d*)";
|
||||
if($_ -match $regex) {
|
||||
$_ = $_ -replace $regex,"$($defstr)$(([int]$matches["BuildVersion"])+1)"
|
||||
}
|
||||
$_
|
||||
} |
|
||||
Out-File $args[0] -encoding ascii -nonewline
|
Loading…
x
Reference in New Issue
Block a user