From e0dc23367cb8bf4c0dab3e3e8016a16637b636ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 24 Jan 2024 21:08:15 +0100 Subject: [PATCH] Remove now unused `year` member from `version.py` We changed copyright to use "present" for the current year, so we no longer need to hardcode this and (like now) forget to bump it yearly. --- core/config/engine.cpp | 1 - core/version.h | 6 ++++++ doc/classes/Engine.xml | 1 - methods.py | 2 -- platform/windows/godot_res.rc | 14 +++++--------- platform/windows/godot_res_wrap.rc | 14 +++++--------- thirdparty/miniupnpc/src/miniupnpcstrings.h | 4 +--- version.py | 1 - 8 files changed, 17 insertions(+), 26 deletions(-) diff --git a/core/config/engine.cpp b/core/config/engine.cpp index 24080c056a0..203f8c38826 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -110,7 +110,6 @@ Dictionary Engine::get_version_info() const { dict["hex"] = VERSION_HEX; dict["status"] = VERSION_STATUS; dict["build"] = VERSION_BUILD; - dict["year"] = VERSION_YEAR; String hash = String(VERSION_HASH); dict["hash"] = hash.is_empty() ? String("unknown") : hash; diff --git a/core/version.h b/core/version.h index 5ddb09284e4..abb81312ac9 100644 --- a/core/version.h +++ b/core/version.h @@ -33,6 +33,12 @@ #include "core/version_generated.gen.h" +// Copied from typedefs.h to stay lean. +#ifndef _STR +#define _STR(m_x) #m_x +#define _MKSTR(m_x) _STR(m_x) +#endif + // Godot versions are of the form . for the initial release, // and then .. for subsequent bugfix releases where != 0 // That's arbitrary, but we find it pretty and it's the current policy. diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 653dc4fd888..580756c12d0 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -179,7 +179,6 @@ [code]status[/code] - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String [code]build[/code] - Holds the build name (e.g. "custom_build") as a String [code]hash[/code] - Holds the full Git commit hash as a String - [code]year[/code] - Holds the year the version was released in as an int [code]string[/code] - [code]major[/code] + [code]minor[/code] + [code]patch[/code] + [code]status[/code] + [code]build[/code] in a single String The [code]hex[/code] value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be [code]0x03010C[/code]. [b]Note:[/b] It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: [codeblocks] diff --git a/methods.py b/methods.py index a55c622ed0d..f36591d211c 100644 --- a/methods.py +++ b/methods.py @@ -163,7 +163,6 @@ def get_version_info(module_version_string="", silent=False): "status": str(version.status), "build": str(build_name), "module_config": str(version.module_config) + module_version_string, - "year": int(version.year), "website": str(version.website), "docs_branch": str(version.docs), } @@ -232,7 +231,6 @@ def generate_version_header(module_version_string=""): #define VERSION_STATUS "{status}" #define VERSION_BUILD "{build}" #define VERSION_MODULE_CONFIG "{module_config}" -#define VERSION_YEAR {year} #define VERSION_WEBSITE "{website}" #define VERSION_DOCS_BRANCH "{docs_branch}" #define VERSION_DOCS_URL "https://docs.godotengine.org/en/" VERSION_DOCS_BRANCH diff --git a/platform/windows/godot_res.rc b/platform/windows/godot_res.rc index 0593c8b0690..8187c0c9360 100644 --- a/platform/windows/godot_res.rc +++ b/platform/windows/godot_res.rc @@ -1,16 +1,12 @@ #include "core/version.h" -#ifndef _STR -#define _STR(m_x) #m_x -#define _MKSTR(m_x) _STR(m_x) -#endif GODOT_ICON ICON platform/windows/godot.ico 1 VERSIONINFO -FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 -PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 -FILEOS 4 -FILETYPE 1 +FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +FILEOS 4 +FILETYPE 1 BEGIN BLOCK "StringFileInfo" BEGIN @@ -21,7 +17,7 @@ BEGIN VALUE "FileVersion", VERSION_NUMBER VALUE "ProductName", VERSION_NAME VALUE "Licence", "MIT" - VALUE "LegalCopyright", "Copyright (c) 2007-" _MKSTR(VERSION_YEAR) " Juan Linietsky, Ariel Manzur and contributors" + VALUE "LegalCopyright", "(c) 2007-present Juan Linietsky, Ariel Manzur and Godot Engine contributors" VALUE "Info", "https://godotengine.org" VALUE "ProductVersion", VERSION_FULL_BUILD END diff --git a/platform/windows/godot_res_wrap.rc b/platform/windows/godot_res_wrap.rc index 9dd29afe513..27ad26cbc54 100644 --- a/platform/windows/godot_res_wrap.rc +++ b/platform/windows/godot_res_wrap.rc @@ -1,16 +1,12 @@ #include "core/version.h" -#ifndef _STR -#define _STR(m_x) #m_x -#define _MKSTR(m_x) _STR(m_x) -#endif GODOT_ICON ICON platform/windows/godot_console.ico 1 VERSIONINFO -FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 -PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 -FILEOS 4 -FILETYPE 1 +FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +FILEOS 4 +FILETYPE 1 BEGIN BLOCK "StringFileInfo" BEGIN @@ -21,7 +17,7 @@ BEGIN VALUE "FileVersion", VERSION_NUMBER VALUE "ProductName", VERSION_NAME " (Console)" VALUE "Licence", "MIT" - VALUE "LegalCopyright", "Copyright (c) 2007-" _MKSTR(VERSION_YEAR) " Juan Linietsky, Ariel Manzur and contributors" + VALUE "LegalCopyright", "(c) 2007-present Juan Linietsky, Ariel Manzur and Godot Engine contributors" VALUE "Info", "https://godotengine.org" VALUE "ProductVersion", VERSION_FULL_BUILD END diff --git a/thirdparty/miniupnpc/src/miniupnpcstrings.h b/thirdparty/miniupnpc/src/miniupnpcstrings.h index d89d9e443bf..5ad694754fd 100644 --- a/thirdparty/miniupnpc/src/miniupnpcstrings.h +++ b/thirdparty/miniupnpc/src/miniupnpcstrings.h @@ -1,9 +1,7 @@ #ifndef MINIUPNPCSTRINGS_H_INCLUDED #define MINIUPNPCSTRINGS_H_INCLUDED -#include "core/version.h" - -#define OS_STRING VERSION_NAME "/1.0" +#define OS_STRING "Godot Engine/1.0" #define MINIUPNPC_VERSION_STRING "2.2.5" #if 0 diff --git a/version.py b/version.py index 99e56eca908..e915a6e530b 100644 --- a/version.py +++ b/version.py @@ -5,6 +5,5 @@ minor = 3 patch = 0 status = "dev" module_config = "" -year = 2023 website = "https://godotengine.org" docs = "latest"