-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce version control by external py
- Loading branch information
1 parent
40d2631
commit 1ec57b7
Showing
8 changed files
with
138 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import time | ||
import re | ||
|
||
RX_BUILD = r"#define VERSION_BUILD (.+)" | ||
RX_TIME = r"#define BUILD_TIME (.+)" | ||
|
||
originlines = open("Version.h", 'r').readlines() | ||
newlines = [] | ||
for l in originlines: | ||
if (mb := re.match(RX_BUILD, l)) is not None: | ||
bn = int(mb[1])+1 | ||
newlines.append(f"#define VERSION_BUILD {bn}\n") | ||
elif (mt := re.match(RX_TIME, l)) is not None: | ||
tm = time.strftime(r"%y%m%d%H%M", time.gmtime()) | ||
newlines.append(f"#define BUILD_TIME {tm}\n") | ||
else: | ||
newlines.append(l) | ||
open("Version.h", 'w', newline='\r\n').writelines(newlines) |
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Version.h | ||
// Revision number is used in next Release build | ||
|
||
#pragma once | ||
|
||
#ifndef VERSION_NUM_H | ||
#define VERSION_NUM_H | ||
|
||
#define STR_(s) #s | ||
#define STR(s) STR_(s) | ||
#define VERSION_MAJOR 2 | ||
#define VERSION_MINOR 1 | ||
#define VERSION_REVISION 0 | ||
#define BUILD_TIME 2404201809 | ||
|
||
#define VERSION_FILE VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION | ||
#define VERSION_FILE_STR \ | ||
STR(VERSION_MAJOR) \ | ||
"." STR(VERSION_MINOR) \ | ||
"." STR(VERSION_REVISION) | ||
|
||
#define VERSION_PRODUCT VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION,BUILD_TIME | ||
#define VERSION_PRODUCT_STR \ | ||
STR(VERSION_MAJOR) \ | ||
"." STR(VERSION_MINOR) \ | ||
"." STR(VERSION_REVISION) \ | ||
"." STR(BUILD_TIME) | ||
|
||
#ifdef DEBUG | ||
|
||
#define VERSION_DISPLAY VERSION_FILE_STR "d" STR(BUILD_TIME) | ||
|
||
#else | ||
|
||
#define VERSION_DISPLAY VERSION_FILE_STR "r" STR(BUILD_TIME) | ||
|
||
#endif // DEBUG | ||
|
||
#endif // VERSION_NUM_H |
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,14 @@ | ||
//{{NO_DEPENDENCIES}} | ||
// Microsoft Visual C++ generated include file. | ||
// Used by UniSequence.rc | ||
|
||
// жÔÏóµÄÏÂÒ»×éĬÈÏÖµ | ||
// | ||
#ifdef APSTUDIO_INVOKED | ||
#ifndef APSTUDIO_READONLY_SYMBOLS | ||
#define _APS_NEXT_RESOURCE_VALUE 101 | ||
#define _APS_NEXT_COMMAND_VALUE 40001 | ||
#define _APS_NEXT_CONTROL_VALUE 1001 | ||
#define _APS_NEXT_SYMED_VALUE 101 | ||
#endif | ||
#endif |
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,39 @@ | ||
// Version.h | ||
// Revision number is used in next Release build | ||
|
||
#pragma once | ||
|
||
#ifndef VERSION_NUM_H | ||
#define VERSION_NUM_H | ||
|
||
#define STR_(s) #s | ||
#define STR(s) STR_(s) | ||
#define VERSION_MAJOR 3 | ||
#define VERSION_MINOR 4 | ||
#define VERSION_REVISION 0 | ||
#define BUILD_TIME 2404201803 | ||
|
||
#define VERSION_FILE VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION | ||
#define VERSION_FILE_STR \ | ||
STR(VERSION_MAJOR) \ | ||
"." STR(VERSION_MINOR) \ | ||
"." STR(VERSION_REVISION) | ||
|
||
#define VERSION_PRODUCT VERSION_MAJOR,VERSION_MINOR,VERSION_REVISION,BUILD_TIME | ||
#define VERSION_PRODUCT_STR \ | ||
STR(VERSION_MAJOR) \ | ||
"." STR(VERSION_MINOR) \ | ||
"." STR(VERSION_REVISION) \ | ||
"." STR(BUILD_TIME) | ||
|
||
#ifdef DEBUG | ||
|
||
#define VERSION_DISPLAY VERSION_FILE_STR "d" STR(BUILD_TIME) | ||
|
||
#else | ||
|
||
#define VERSION_DISPLAY VERSION_FILE_STR "r" STR(BUILD_TIME) | ||
|
||
#endif // DEBUG | ||
|
||
#endif // VERSION_NUM_H |