-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprebuild.bat
More file actions
27 lines (21 loc) · 855 Bytes
/
prebuild.bat
File metadata and controls
27 lines (21 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@echo off
git rev-parse --short HEAD >post.tmp
set /p result=<post.tmp
git rev-parse --symbolic-full-name --abbrev-ref HEAD >post.tmp
set /p result2=<post.tmp
set timestamp=%DATE:/=-%@%TIME::=-%
set timestamp=%timestamp: =%
if not exist BUILD.txt >BUILD.txt echo 0
for /f %%x in (BUILD.txt) do (
set /a build=%%x+1
)
echo #pragma once > src/gitversion.h
echo static const char GitStr[] ="%result%.%result2%"; >> src/gitversion.h
echo static const char GitHash[] ="%result%"; >> src/gitversion.h
echo static const char BuildDate[] = "%timestamp%"; >> src/gitversion.h
echo static const char BuildNumber[] = "%build%"; >> src/gitversion.h
echo #define VER_BUILD %build% >> src/gitversion.h
echo #define VER_HASH "%result%" >> src/gitversion.h
echo #define VER_GITSTR "%result%.%result2%" >> src/gitversion.h
echo %build% > BUILD.TXT
del post.tmp