From f83805a05f3998d0d57874cb1d184607c00d235d Mon Sep 17 00:00:00 2001 From: AnotherCommander Date: Tue, 24 Feb 2026 11:40:54 +0200 Subject: [PATCH 1/4] Enabled full version string inlining and build type distinction in core manifest.plist. The macro OO_VERSION_FULL is set to contain the full version string right off the GNUmakefile build command. The full version string is now set under the version key in the core manifest.plist. Additionally, the build type is now also inlined in the core manifest.plist under the key debug_functionality_disabled, which takes a yes/no value depending on whether we are building deployment or not. --- GNUmakefile | 20 ++++++++++++++++++-- GNUmakefile.postamble | 4 +++- src/SDL/main.m | 6 ++++++ tools/mkmanifest.sh | 4 +++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 9d87bf0e2..bf2441ec4 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,6 +11,22 @@ ifeq ($(GNUSTEP_HOST_OS),mingw32) endif GNUSTEP_OBJ_DIR_BASENAME := $(GNUSTEP_OBJ_DIR_NAME) +VERSION := $(shell cat src/Cocoa/oolite-version.xcconfig | cut -d '=' -f 2) +VER_MAJ := $(shell echo $(VERSION) | cut -d. -f1) +VER_MIN := $(shell echo $(VERSION) | cut -d. -f2) +VER_REV := $(shell echo $(VERSION) | cut -d. -f3) +ifeq ($(VER_REV),) + VER_REV = 0 +endif +VER_DATE := $(shell date +%y%m%d) +VER_GITREV := $(shell git rev-list --count HEAD) +VER_GITHASH := $(shell git rev-parse --short=7 HEAD) +VER_FULL := $(VER_MAJ).$(VER_MIN).$(VER_REV).$(VER_GITREV)-$(VER_DATE)-$(VER_GITHASH) + +ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),) +DEPLOYMENT_RELEASE_CONFIGURATION := no +endif + ifeq ($(GNUSTEP_HOST_OS),mingw32) vpath %.rc src/SDL/OOResourcesWin @@ -104,8 +120,8 @@ endif # add specific flags if building modern ifeq ($(modern),yes) - ADDITIONAL_CFLAGS += -DOOLITE_MODERN_BUILD=1 - ADDITIONAL_OBJCFLAGS += -DOOLITE_MODERN_BUILD=1 + ADDITIONAL_CFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\" + ADDITIONAL_OBJCFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\" # link time optimizations ifeq ($(lto),yes) ADDITIONAL_CFLAGS += -flto diff --git a/GNUmakefile.postamble b/GNUmakefile.postamble index ad431c440..cd93fdd80 100644 --- a/GNUmakefile.postamble +++ b/GNUmakefile.postamble @@ -9,11 +9,13 @@ POST_BUILD_ENV = \ GNUSTEP_HOST_CPU="$(GNUSTEP_HOST_CPU)" \ MINGW_PREFIX="$(MINGW_PREFIX)" \ DEBUG="$(debug)" \ + DEPLOYMENT_RELEASE_CONFIGURATION="$(DEPLOYMENT_RELEASE_CONFIGURATION)" \ MODERN="$(modern)" \ ESPEAK="$(ESPEAK)" \ USE_DEPS="$(use_deps)" \ STRIP_BIN="$(strip)" \ - STRIP="$(STRIP)" + STRIP="$(STRIP)" \ + VER_FULL="$(VER_FULL)" after-all:: @$(POST_BUILD_ENV) ShellScripts/common/post_build.sh diff --git a/src/SDL/main.m b/src/SDL/main.m index 7f75b523d..dd24fb586 100644 --- a/src/SDL/main.m +++ b/src/SDL/main.m @@ -49,6 +49,11 @@ uint32_t gDebugFlags = 0; #endif +// This macro is normally defined in the build command +#ifndef OO_VERSION_FULL +#define OO_VERSION_FULL "Undefined" +#endif + /** * \ingroup cli * Entry point for Linux and Windows systems. @@ -186,6 +191,7 @@ int main(int argc, char *argv[]) "--xml"TABS3 TABS4"When compiling or exporting\n"TABS3 TABS4"system descriptions, use xml\n"TABS3 TABS4"format *\n" "\n" "Options marked with \"*\" are available only in Test Release configuration.\n" + "Version "OO_VERSION_FULL"\n" "Built with " #if OOLITE_HAVE_CLANG "Clang version " STRINGIFY(__clang_major__) "." STRINGIFY(__clang_minor__) "." STRINGIFY(__clang_patchlevel__) diff --git a/tools/mkmanifest.sh b/tools/mkmanifest.sh index 0153bff47..9bed847a4 100755 --- a/tools/mkmanifest.sh +++ b/tools/mkmanifest.sh @@ -18,7 +18,9 @@ echo "{" echo " title = \"Oolite core\";" echo " identifier = \"org.oolite.oolite\";" echo " " -echo " version = \"$OOLITE_VERSION\";" +# echo " version = \"$OOLITE_VERSION\";" +echo " version = \"$VER_FULL\";" +echo " debug_functionality_disabled = \"$DEPLOYMENT_RELEASE_CONFIGURATION\";" echo " required_oolite_version = \"$OOLITE_VERSION\";" echo " " echo " license = \"GPL 2+ / CC-BY-NC-SA 3.0 - see LICENSE.md for details\";" From d44b9f889b132431256c1a238797bda6138aff8b Mon Sep 17 00:00:00 2001 From: AnotherCommander Date: Tue, 24 Feb 2026 18:55:07 +0200 Subject: [PATCH 2/4] The full version string is now printed in the log header and the main title screen when the -showversion argument is used. Also, fixed snapshot build watermark not showing the game version. --- Makefile | 2 +- src/Core/Entities/PlayerEntity.m | 2 +- src/Core/OOLogHeader.m | 6 +++--- src/Core/Universe.m | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ac877f027..7d5140dcb 100755 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ release-deployment: .PHONY: release-snapshot release-snapshot: - $(MAKE) -f GNUmakefile SNAPSHOT_BUILD=yes VERSION_STRING=$(VER) debug=no + $(MAKE) -f GNUmakefile SNAPSHOT_BUILD=yes debug=no mkdir -p AddOns && rm -rf AddOns/Basic-debug.oxp && cp -rf DebugOXP/Debug.oxp AddOns/Basic-debug.oxp .PHONY: debug diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index ce584003f..cca448385 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -10075,7 +10075,7 @@ - (void) setGuiToIntroFirstGo:(BOOL)justCobra if ([[arguments objectAtIndex:i] isEqual:@"-showversion"]) { OOGUIRow ms_start = msgLine; - NSString *version = [NSString stringWithFormat:@"Version %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]; + NSString *version = [NSString stringWithFormat:@"Version %s", OO_VERSION_FULL]; OOGUIRow i = msgLine = [gui addLongText:version startingAtRow:ms_start align:GUI_ALIGN_CENTER]; for (i-- ; i >= ms_start; i--) { diff --git a/src/Core/OOLogHeader.m b/src/Core/OOLogHeader.m index 1839d8839..b015a3ce6 100644 --- a/src/Core/OOLogHeader.m +++ b/src/Core/OOLogHeader.m @@ -161,10 +161,10 @@ void OOPrintLogHeader(void) #endif NSString *versionString = nil; - #if (defined (SNAPSHOT_BUILD) && defined (OOLITE_SNAPSHOT_VERSION)) - versionString = @"development version " OOLITE_SNAPSHOT_VERSION; + #if (defined (SNAPSHOT_BUILD)) // && defined (OOLITE_SNAPSHOT_VERSION)) + versionString = @"development version " @OO_VERSION_FULL; #else - versionString = [NSString stringWithFormat:@"version %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]; + versionString = [NSString stringWithFormat:@"version %s", OO_VERSION_FULL]; #endif if (versionString == nil) versionString = @""; diff --git a/src/Core/Universe.m b/src/Core/Universe.m index ee70aca4e..8f6425f3f 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -5229,8 +5229,8 @@ - (void) drawUniverse // should come after the HUD to avoid it being overlapped by it [self drawMessage]; -#if (defined (SNAPSHOT_BUILD) && defined (OOLITE_SNAPSHOT_VERSION)) - [self drawWatermarkString:@"Development version " @OOLITE_SNAPSHOT_VERSION]; +#if (defined (SNAPSHOT_BUILD)) // && defined (OOLITE_SNAPSHOT_VERSION)) + [self drawWatermarkString:@"Development version " @OO_VERSION_FULL]; #endif OOLog(@"universe.profile.drawHUD", @"%@", @"End HUD drawing"); From dc76e30183202c12faa78e8cb9709ec652d77b37 Mon Sep 17 00:00:00 2001 From: AnotherCommander Date: Tue, 24 Feb 2026 19:08:47 +0200 Subject: [PATCH 3/4] Removed some commented out code from previous commit. --- src/Core/OOLogHeader.m | 2 +- src/Core/Universe.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/OOLogHeader.m b/src/Core/OOLogHeader.m index b015a3ce6..b842f2bdd 100644 --- a/src/Core/OOLogHeader.m +++ b/src/Core/OOLogHeader.m @@ -161,7 +161,7 @@ void OOPrintLogHeader(void) #endif NSString *versionString = nil; - #if (defined (SNAPSHOT_BUILD)) // && defined (OOLITE_SNAPSHOT_VERSION)) + #if (defined (SNAPSHOT_BUILD)) versionString = @"development version " @OO_VERSION_FULL; #else versionString = [NSString stringWithFormat:@"version %s", OO_VERSION_FULL]; diff --git a/src/Core/Universe.m b/src/Core/Universe.m index 8f6425f3f..8c3afa3e1 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -5229,7 +5229,7 @@ - (void) drawUniverse // should come after the HUD to avoid it being overlapped by it [self drawMessage]; -#if (defined (SNAPSHOT_BUILD)) // && defined (OOLITE_SNAPSHOT_VERSION)) +#if (defined (SNAPSHOT_BUILD)) [self drawWatermarkString:@"Development version " @OO_VERSION_FULL]; #endif From fa71725992c45be4505d6e6090ab2657e8580cf4 Mon Sep 17 00:00:00 2001 From: AnotherCommander Date: Wed, 25 Feb 2026 09:46:04 +0200 Subject: [PATCH 4/4] Moved deployment build recognition logic to mkmanifest.sh and changed the key debug_functionality_disabled to debug_functionality_support, where yes means a test release or snapshot build and no means a deployment build. --- GNUmakefile | 3 --- tools/mkmanifest.sh | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index bf2441ec4..23e12a98c 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -23,9 +23,6 @@ VER_GITREV := $(shell git rev-list --count HEAD) VER_GITHASH := $(shell git rev-parse --short=7 HEAD) VER_FULL := $(VER_MAJ).$(VER_MIN).$(VER_REV).$(VER_GITREV)-$(VER_DATE)-$(VER_GITHASH) -ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),) -DEPLOYMENT_RELEASE_CONFIGURATION := no -endif ifeq ($(GNUSTEP_HOST_OS),mingw32) vpath %.rc src/SDL/OOResourcesWin diff --git a/tools/mkmanifest.sh b/tools/mkmanifest.sh index 9bed847a4..1d380a8b6 100755 --- a/tools/mkmanifest.sh +++ b/tools/mkmanifest.sh @@ -18,9 +18,12 @@ echo "{" echo " title = \"Oolite core\";" echo " identifier = \"org.oolite.oolite\";" echo " " -# echo " version = \"$OOLITE_VERSION\";" echo " version = \"$VER_FULL\";" -echo " debug_functionality_disabled = \"$DEPLOYMENT_RELEASE_CONFIGURATION\";" +if [ "$DEPLOYMENT_RELEASE_CONFIGURATION" = "yes" ]; then + echo " debug_functionality_support = no;" +else + echo " debug_functionality_support = yes;" +fi echo " required_oolite_version = \"$OOLITE_VERSION\";" echo " " echo " license = \"GPL 2+ / CC-BY-NC-SA 3.0 - see LICENSE.md for details\";"