iOS: Allow change of bundle identifier

This patch allows users to set a bundle identifier,
without opening Xcode (set as env. variable).

If the env. variable is not set (like e.g. on Travis) it defaults
to org....

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-05-10 17:55:09 +02:00 committed by Dirk Hohndel
parent a1e9cce50a
commit ff15d48f69
2 changed files with 15 additions and 11 deletions

View file

@ -13,7 +13,8 @@ Follow the instruction in:
and then continue here: and then continue here:
1) cd <repo>/packaging/ios 1) cd <repo>/packaging/ios
2) ./build.sh 2) export IOS_BUNDLE_PRODUCT_IDENTIFIER="<your apple id>.subsurface-divelog.subsurface-mobile"
3) ./build.sh
note: this builds all dependencies and is only needed first time note: this builds all dependencies and is only needed first time
it currently build for armv7 arm64 and x86_64 (simulator) it currently build for armv7 arm64 and x86_64 (simulator)
@ -42,3 +43,7 @@ the hood) gets updated. Otherwise you will continue to see the old version
number, even though the sources have been recompiled which can be very number, even though the sources have been recompiled which can be very
confusing. confusing.
Do a simply version update by running:
build.sh version
and then rebuilding in Qt Creator

View file

@ -4,7 +4,7 @@
set -x set -x
set -e set -e
PRODUCT_BUNDLE_IDENTIFIER="\$(PRODUCT_BUNDLE_IDENTIFIER)" doVersion=$1
DEBUGRELEASE="Release" DEBUGRELEASE="Release"
DRCONFIG="release" DRCONFIG="release"
ARCHS="armv7 arm64 x86_64" ARCHS="armv7 arm64 x86_64"
@ -14,12 +14,6 @@ TARGET2="Device"
while [[ $# -gt 0 ]] ; do while [[ $# -gt 0 ]] ; do
arg="$1" arg="$1"
case $arg in case $arg in
-official)
# build an app identified as org.subsurface-divelog.subsurface-mobile
# without having to set this explicitly in Xcode (this way this works,
# e.g., in Travis)
PRODUCT_BUNDLE_IDENTIFIER="org.subsurface-divelog.subsurface-mobile"
;;
-debug) -debug)
# build for debugging # build for debugging
DEBUGRELEASE="Debug" DEBUGRELEASE="Debug"
@ -86,10 +80,15 @@ echo "#define GIT_VERSION_STRING \"$GITVERSION\"" > subsurface-mobile/ssrf-versi
echo "#define CANONICAL_VERSION_STRING \"$CANONICALVERSION\"" >> subsurface-mobile/ssrf-version.h echo "#define CANONICAL_VERSION_STRING \"$CANONICALVERSION\"" >> subsurface-mobile/ssrf-version.h
echo "#define MOBILE_VERSION_STRING \"$MOBILEVERSION\"" >> subsurface-mobile/ssrf-version.h echo "#define MOBILE_VERSION_STRING \"$MOBILEVERSION\"" >> subsurface-mobile/ssrf-version.h
# create Info.plist with the correct versions BUNDLE=org.subsurface-divelog.subsurface-mobile
cat Info.plist.in | sed "s/@MOBILE_VERSION@/$MOBILEVERSION/;s/@CANONICAL_VERSION@/$CANONICALVERSION/;s/@PRODUCT_BUNDLE_IDENTIFIER@/$PRODUCT_BUNDLE_IDENTIFIER/" > Info.plist if [ "${IOS_BUNDLE_PRODUCT_IDENTIFIER}" != "" ] ; then
BUNDLE=${IOS_BUNDLE_PRODUCT_IDENTIFIER}
fi
if [ "$1" = "version" ] ; then # create Info.plist with the correct versions
cat Info.plist.in | sed "s/@MOBILE_VERSION@/$MOBILEVERSION/;s/@CANONICAL_VERSION@/$CANONICALVERSION/;s/@PRODUCT_BUNDLE_IDENTIFIER@/$BUNDLE/" > Info.plist
if [ "$doVersion" = "version" ] ; then
exit 0 exit 0
fi fi