Promote git revision number to 4th version string component

This commit is contained in:
Arkshine 2018-09-11 00:46:07 +02:00
parent 8a720a7d6a
commit c9e9ef905e
2 changed files with 4 additions and 6 deletions

View File

@ -1 +1 @@
1.9.0-dev 1.9.0

View File

@ -55,12 +55,10 @@ def output_version_headers():
if m == None: if m == None:
raise Exception('Could not detremine product version') raise Exception('Could not detremine product version')
major, minor, release, tag = m.groups() major, minor, release, tag = m.groups()
product = "{0}.{1}.{2}".format(major, minor, release) product = "{0}.{1}.{2}.{3}".format(major, minor, release, count)
fullstring = product fullstring = product
if tag != "": if tag != "":
fullstring += "-{0}".format(tag) fullstring += "-{0}".format(tag)
if tag == "dev":
fullstring += "+{0}".format(count)
with open(os.path.join(OutputFolder, 'amxmodx_version_auto.h'), 'w') as fp: with open(os.path.join(OutputFolder, 'amxmodx_version_auto.h'), 'w') as fp:
fp.write(""" fp.write("""
@ -74,10 +72,10 @@ def output_version_headers():
#define AMXX_BUILD_RELEASE \"{4}\" #define AMXX_BUILD_RELEASE \"{4}\"
#define AMXX_BUILD_LOCAL_REV \"{6}\" #define AMXX_BUILD_LOCAL_REV \"{6}\"
#define AMXX_BUILD_UNIQUEID "{6}:" AMXX_BUILD_CSET #define AMXX_BUILD_UNIQUEID AMXX_BUILD_LOCAL_REV \":\" AMXX_BUILD_CSET
#define AMXX_VERSION_STRING \"{5}\" #define AMXX_VERSION_STRING \"{5}\"
#define AMXX_VERSION_FILE {2},{3},{4},0 #define AMXX_VERSION_FILE {2},{3},{4},{6}
#endif // _AMXMODX_AUTO_VERSION_INFORMATION_H_ #endif // _AMXMODX_AUTO_VERSION_INFORMATION_H_
""".format(tag, shorthash, major, minor, release, fullstring, count)) """.format(tag, shorthash, major, minor, release, fullstring, count))