-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI/Lua: Show REF version (commit/tag) and APIs to obtain it
- Loading branch information
Showing
6 changed files
with
159 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ src/sdk/generated | |
cmake-build* | ||
.idea/ | ||
build_vs2019_devmode_DMC5.bat | ||
src/CommitHash.autogenerated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@echo off | ||
|
||
IF EXIST "src/CommitHash.autogenerated" ( | ||
echo The file "src/CommitHash.autogenerated" already exists. | ||
exit /b 0 | ||
) | ||
|
||
FOR /F "tokens=*" %%g IN ('git rev-parse HEAD') DO (SET REF_COMMIT_HASH=%%g) | ||
|
||
FOR /F "tokens=*" %%t IN ('git describe --tags --abbrev^=0') DO (SET REF_TAG=%%t) | ||
|
||
FOR /F "tokens=*" %%c IN ('git describe --tags --long') DO ( | ||
FOR /F "tokens=1,2 delims=-" %%a IN ("%%c") DO ( | ||
SET REF_TAG_LONG=%%a | ||
SET REF_COMMITS_PAST_TAG=%%b | ||
) | ||
) | ||
|
||
FOR /F "tokens=2 delims==" %%a IN ('wmic OS get localdatetime /value') DO ( | ||
SET datetime=%%a | ||
) | ||
|
||
SET year=%datetime:~0,4% | ||
SET month=%datetime:~4,2% | ||
SET day=%datetime:~6,2% | ||
SET hour=%datetime:~8,2% | ||
SET minute=%datetime:~10,2% | ||
|
||
echo #pragma once > src/CommitHash.autogenerated | ||
echo #define REF_COMMIT_HASH "%REF_COMMIT_HASH%" >> src/CommitHash.autogenerated | ||
echo #define REF_TAG "%REF_TAG%" >> src/CommitHash.autogenerated | ||
echo #define REF_TAG_LONG "%REF_TAG_LONG%" >> src/CommitHash.autogenerated | ||
echo #define REF_COMMITS_PAST_TAG %REF_COMMITS_PAST_TAG% >> src/CommitHash.autogenerated | ||
echo #define REF_BUILD_DATE "%day%.%month%.%year%" >> src/CommitHash.autogenerated | ||
echo #define REF_BUILD_TIME "%hour%:%minute%" >> src/CommitHash.autogenerated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters