Skip to content

Commit 3fd23da

Browse files
committed
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.
1 parent 6947bed commit 3fd23da

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

core/engine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Dictionary Engine::get_version_info() const {
8585
dict["patch"] = 0;
8686
#endif
8787
dict["status"] = VERSION_STATUS;
88-
dict["revision"] = VERSION_REVISION;
88+
dict["build"] = VERSION_BUILD;
8989
dict["year"] = VERSION_YEAR;
9090

9191
String hash = VERSION_HASH;
@@ -94,7 +94,7 @@ Dictionary Engine::get_version_info() const {
9494
String stringver = String(dict["major"]) + "." + String(dict["minor"]);
9595
if ((int)dict["patch"] != 0)
9696
stringver += "." + String(dict["patch"]);
97-
stringver += "-" + String(dict["status"]) + " (" + String(dict["revision"]) + ")";
97+
stringver += "-" + String(dict["status"]) + " (" + String(dict["build"]) + ")";
9898
dict["string"] = stringver;
9999

100100
return dict;

core/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#include "version_generated.gen.h"
3131

3232
#ifdef VERSION_PATCH
33-
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) "." VERSION_STATUS "." VERSION_REVISION VERSION_MODULE_CONFIG
33+
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." _MKSTR(VERSION_PATCH) "." VERSION_STATUS "." VERSION_BUILD VERSION_MODULE_CONFIG
3434
#else
35-
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." VERSION_STATUS "." VERSION_REVISION VERSION_MODULE_CONFIG
35+
#define VERSION_MKSTRING "" _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "." VERSION_STATUS "." VERSION_BUILD VERSION_MODULE_CONFIG
3636
#endif // VERSION_PATCH
3737
#define VERSION_FULL_NAME "" VERSION_NAME " v" VERSION_MKSTRING

doc/classes/Engine.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"minor" - Holds the minor version number as a String
7272
"patch" - Holds the patch version number as a String
7373
"status" - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
74-
"revision" - Holds the revision (e.g. "custom-build") as a String
75-
"string" - major + minor + patch + status + revision in a single String
74+
"build" - Holds the build name (e.g. "custom-build") as a String
75+
"string" - major + minor + patch + status + build in a single String
7676
</description>
7777
</method>
7878
<method name="has_singleton" qualifiers="const">

methods.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,11 +1154,11 @@ def add_module_version_string(self,s):
11541154

11551155
def update_version(module_version_string=""):
11561156

1157-
rev = "custom_build"
1157+
build_name = "custom_build"
1158+
if (os.getenv("BUILD_NAME") != None):
1159+
build_name = os.getenv("BUILD_NAME")
1160+
print("Using custom build name: " + build_name)
11581161

1159-
if (os.getenv("BUILD_REVISION") != None):
1160-
rev = os.getenv("BUILD_REVISION")
1161-
print("Using custom revision: " + rev)
11621162
import version
11631163

11641164
f = open("core/version_generated.gen.h", "w")
@@ -1168,8 +1168,8 @@ def update_version(module_version_string=""):
11681168
f.write("#define VERSION_MINOR " + str(version.minor) + "\n")
11691169
if (hasattr(version, 'patch')):
11701170
f.write("#define VERSION_PATCH " + str(version.patch) + "\n")
1171-
f.write("#define VERSION_REVISION \"" + str(rev) + "\"\n")
11721171
f.write("#define VERSION_STATUS \"" + str(version.status) + "\"\n")
1172+
f.write("#define VERSION_BUILD \"" + str(build_name) + "\"\n")
11731173
f.write("#define VERSION_MODULE_CONFIG \"" + str(version.module_config) + module_version_string + "\"\n")
11741174
import datetime
11751175
f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n")

platform/windows/godot_res.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ BEGIN
2929
VALUE "Licence", "MIT"
3030
VALUE "LegalCopyright", "Copyright (c) 2007-" _MKSTR(VERSION_YEAR) " Juan Linietsky, Ariel Manzur"
3131
VALUE "Info", "https://godotengine.org"
32-
VALUE "ProductVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) PATCH_STRING "." VERSION_REVISION
32+
VALUE "ProductVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) PATCH_STRING "." VERSION_BUILD
3333
END
3434
END
3535
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)