Skip to content

Commit f83805a

Browse files
author
AnotherCommander
committed
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.
1 parent 11b667a commit f83805a

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

GNUmakefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ ifeq ($(GNUSTEP_HOST_OS),mingw32)
1111
endif
1212
GNUSTEP_OBJ_DIR_BASENAME := $(GNUSTEP_OBJ_DIR_NAME)
1313

14+
VERSION := $(shell cat src/Cocoa/oolite-version.xcconfig | cut -d '=' -f 2)
15+
VER_MAJ := $(shell echo $(VERSION) | cut -d. -f1)
16+
VER_MIN := $(shell echo $(VERSION) | cut -d. -f2)
17+
VER_REV := $(shell echo $(VERSION) | cut -d. -f3)
18+
ifeq ($(VER_REV),)
19+
VER_REV = 0
20+
endif
21+
VER_DATE := $(shell date +%y%m%d)
22+
VER_GITREV := $(shell git rev-list --count HEAD)
23+
VER_GITHASH := $(shell git rev-parse --short=7 HEAD)
24+
VER_FULL := $(VER_MAJ).$(VER_MIN).$(VER_REV).$(VER_GITREV)-$(VER_DATE)-$(VER_GITHASH)
25+
26+
ifeq ($(DEPLOYMENT_RELEASE_CONFIGURATION),)
27+
DEPLOYMENT_RELEASE_CONFIGURATION := no
28+
endif
29+
1430
ifeq ($(GNUSTEP_HOST_OS),mingw32)
1531
vpath %.rc src/SDL/OOResourcesWin
1632

@@ -104,8 +120,8 @@ endif
104120

105121
# add specific flags if building modern
106122
ifeq ($(modern),yes)
107-
ADDITIONAL_CFLAGS += -DOOLITE_MODERN_BUILD=1
108-
ADDITIONAL_OBJCFLAGS += -DOOLITE_MODERN_BUILD=1
123+
ADDITIONAL_CFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\"
124+
ADDITIONAL_OBJCFLAGS += -DOOLITE_MODERN_BUILD=1 -DOO_VERSION_FULL=\"$(VER_FULL)\"
109125
# link time optimizations
110126
ifeq ($(lto),yes)
111127
ADDITIONAL_CFLAGS += -flto

GNUmakefile.postamble

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ POST_BUILD_ENV = \
99
GNUSTEP_HOST_CPU="$(GNUSTEP_HOST_CPU)" \
1010
MINGW_PREFIX="$(MINGW_PREFIX)" \
1111
DEBUG="$(debug)" \
12+
DEPLOYMENT_RELEASE_CONFIGURATION="$(DEPLOYMENT_RELEASE_CONFIGURATION)" \
1213
MODERN="$(modern)" \
1314
ESPEAK="$(ESPEAK)" \
1415
USE_DEPS="$(use_deps)" \
1516
STRIP_BIN="$(strip)" \
16-
STRIP="$(STRIP)"
17+
STRIP="$(STRIP)" \
18+
VER_FULL="$(VER_FULL)"
1719

1820
after-all::
1921
@$(POST_BUILD_ENV) ShellScripts/common/post_build.sh

src/SDL/main.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
uint32_t gDebugFlags = 0;
5050
#endif
5151

52+
// This macro is normally defined in the build command
53+
#ifndef OO_VERSION_FULL
54+
#define OO_VERSION_FULL "Undefined"
55+
#endif
56+
5257
/**
5358
* \ingroup cli
5459
* Entry point for Linux and Windows systems.
@@ -186,6 +191,7 @@ int main(int argc, char *argv[])
186191
"--xml"TABS3 TABS4"When compiling or exporting\n"TABS3 TABS4"system descriptions, use xml\n"TABS3 TABS4"format *\n"
187192
"\n"
188193
"Options marked with \"*\" are available only in Test Release configuration.\n"
194+
"Version "OO_VERSION_FULL"\n"
189195
"Built with "
190196
#if OOLITE_HAVE_CLANG
191197
"Clang version " STRINGIFY(__clang_major__) "." STRINGIFY(__clang_minor__) "." STRINGIFY(__clang_patchlevel__)

tools/mkmanifest.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ echo "{"
1818
echo " title = \"Oolite core\";"
1919
echo " identifier = \"org.oolite.oolite\";"
2020
echo " "
21-
echo " version = \"$OOLITE_VERSION\";"
21+
# echo " version = \"$OOLITE_VERSION\";"
22+
echo " version = \"$VER_FULL\";"
23+
echo " debug_functionality_disabled = \"$DEPLOYMENT_RELEASE_CONFIGURATION\";"
2224
echo " required_oolite_version = \"$OOLITE_VERSION\";"
2325
echo " "
2426
echo " license = \"GPL 2+ / CC-BY-NC-SA 3.0 - see LICENSE.md for details\";"

0 commit comments

Comments
 (0)