Rename the version's "revision" to "build"
That "revision" was inherited from SVN days but had been since then used to give information about the build: "custom_build", "official", "<some distro's build>". It can now be overridden with the BUILD_NAME environment variable.
This commit is contained in:
parent
6947bed015
commit
3fd23da5ee
|
@ -85,7 +85,7 @@ Dictionary Engine::get_version_info() const {
|
||||||
dict["patch"] = 0;
|
dict["patch"] = 0;
|
||||||
#endif
|
#endif
|
||||||
dict["status"] = VERSION_STATUS;
|
dict["status"] = VERSION_STATUS;
|
||||||
dict["revision"] = VERSION_REVISION;
|
dict["build"] = VERSION_BUILD;
|
||||||
dict["year"] = VERSION_YEAR;
|
dict["year"] = VERSION_YEAR;
|
||||||
|
|
||||||
String hash = VERSION_HASH;
|
String hash = VERSION_HASH;
|
||||||
|
@ -94,7 +94,7 @@ Dictionary Engine::get_version_info() const {
|
||||||
String stringver = String(dict["major"]) + "." + String(dict["minor"]);
|
String stringver = String(dict["major"]) + "." + String(dict["minor"]);
|
||||||
if ((int)dict["patch"] != 0)
|
if ((int)dict["patch"] != 0)
|
||||||
stringver += "." + String(dict["patch"]);
|
stringver += "." + String(dict["patch"]);
|
||||||
stringver += "-" + String(dict["status"]) + " (" + String(dict["revision"]) + ")";
|
stringver += "-" + String(dict["status"]) + " (" + String(dict["build"]) + ")";
|
||||||
dict["string"] = stringver;
|
dict["string"] = stringver;
|
||||||
|
|
||||||
return dict;
|
return dict;
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
#include "version_generated.gen.h"
|
#include "version_generated.gen.h"
|
||||||
|
|
||||||
#ifdef VERSION_PATCH
|
#ifdef VERSION_PATCH
|
||||||
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) "." VERSION_STATUS "." VERSION_REVISION VERSION_MODULE_CONFIG
|
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) "." VERSION_STATUS "." VERSION_BUILD VERSION_MODULE_CONFIG
|
||||||
#else
|
#else
|
||||||
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." VERSION_STATUS "." VERSION_REVISION VERSION_MODULE_CONFIG
|
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." VERSION_STATUS "." VERSION_BUILD VERSION_MODULE_CONFIG
|
||||||
#endif // VERSION_PATCH
|
#endif // VERSION_PATCH
|
||||||
#define VERSION_FULL_NAME "" VERSION_NAME " v" VERSION_MKSTRING
|
#define VERSION_FULL_NAME "" VERSION_NAME " v" VERSION_MKSTRING
|
||||||
|
|
|
@ -71,8 +71,8 @@
|
||||||
"minor" - Holds the minor version number as a String
|
"minor" - Holds the minor version number as a String
|
||||||
"patch" - Holds the patch version number as a String
|
"patch" - Holds the patch version number as a String
|
||||||
"status" - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
|
"status" - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
|
||||||
"revision" - Holds the revision (e.g. "custom-build") as a String
|
"build" - Holds the build name (e.g. "custom-build") as a String
|
||||||
"string" - major + minor + patch + status + revision in a single String
|
"string" - major + minor + patch + status + build in a single String
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="has_singleton" qualifiers="const">
|
<method name="has_singleton" qualifiers="const">
|
||||||
|
|
10
methods.py
10
methods.py
|
@ -1154,11 +1154,11 @@ def add_module_version_string(self,s):
|
||||||
|
|
||||||
def update_version(module_version_string=""):
|
def update_version(module_version_string=""):
|
||||||
|
|
||||||
rev = "custom_build"
|
build_name = "custom_build"
|
||||||
|
if (os.getenv("BUILD_NAME") != None):
|
||||||
|
build_name = os.getenv("BUILD_NAME")
|
||||||
|
print("Using custom build name: " + build_name)
|
||||||
|
|
||||||
if (os.getenv("BUILD_REVISION") != None):
|
|
||||||
rev = os.getenv("BUILD_REVISION")
|
|
||||||
print("Using custom revision: " + rev)
|
|
||||||
import version
|
import version
|
||||||
|
|
||||||
f = open("core/version_generated.gen.h", "w")
|
f = open("core/version_generated.gen.h", "w")
|
||||||
|
@ -1168,8 +1168,8 @@ def update_version(module_version_string=""):
|
||||||
f.write("#define VERSION_MINOR " + str(version.minor) + "\n")
|
f.write("#define VERSION_MINOR " + str(version.minor) + "\n")
|
||||||
if (hasattr(version, 'patch')):
|
if (hasattr(version, 'patch')):
|
||||||
f.write("#define VERSION_PATCH " + str(version.patch) + "\n")
|
f.write("#define VERSION_PATCH " + str(version.patch) + "\n")
|
||||||
f.write("#define VERSION_REVISION \"" + str(rev) + "\"\n")
|
|
||||||
f.write("#define VERSION_STATUS \"" + str(version.status) + "\"\n")
|
f.write("#define VERSION_STATUS \"" + str(version.status) + "\"\n")
|
||||||
|
f.write("#define VERSION_BUILD \"" + str(build_name) + "\"\n")
|
||||||
f.write("#define VERSION_MODULE_CONFIG \"" + str(version.module_config) + module_version_string + "\"\n")
|
f.write("#define VERSION_MODULE_CONFIG \"" + str(version.module_config) + module_version_string + "\"\n")
|
||||||
import datetime
|
import datetime
|
||||||
f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n")
|
f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n")
|
||||||
|
|
|
@ -29,7 +29,7 @@ BEGIN
|
||||||
VALUE "Licence", "MIT"
|
VALUE "Licence", "MIT"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2007-" _MKSTR(VERSION_YEAR) " Juan Linietsky, Ariel Manzur"
|
VALUE "LegalCopyright", "Copyright (c) 2007-" _MKSTR(VERSION_YEAR) " Juan Linietsky, Ariel Manzur"
|
||||||
VALUE "Info", "https://godotengine.org"
|
VALUE "Info", "https://godotengine.org"
|
||||||
VALUE "ProductVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) PATCH_STRING "." VERSION_REVISION
|
VALUE "ProductVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) PATCH_STRING "." VERSION_BUILD
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in New Issue