summaryrefslogtreecommitdiff
path: root/platform/ios/scripts/package.sh
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-03-23 23:22:05 -0700
committerJesse Bounds <jesse@rebounds.net>2016-03-28 09:52:36 -0700
commit62f636f0c09186c8419dfe1146ad756b1aa5d1eb (patch)
treeaa8366402ccefee4d71d32adfaec87f80aaa3e4e /platform/ios/scripts/package.sh
parent71f6773208f61d9d567eecee5d85ddadf0d0d755 (diff)
downloadqtlocation-mapboxgl-62f636f0c09186c8419dfe1146ad756b1aa5d1eb.tar.gz
[ios] Fix issues with static lib signing and app store submission
Fix issues with static build configuration that caused it to be problematic for host applications when they were installed on device. Also fixes issues that broke the iTunes Connect validation and upload process. This also updates the `binary` instructions in INSTALL.md to reflect these changes.
Diffstat (limited to 'platform/ios/scripts/package.sh')
-rwxr-xr-xplatform/ios/scripts/package.sh30
1 files changed, 23 insertions, 7 deletions
diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh
index 9f843785e0..137775ef71 100755
--- a/platform/ios/scripts/package.sh
+++ b/platform/ios/scripts/package.sh
@@ -27,13 +27,28 @@ if [[ ${BUNDLE_RESOURCES} ]]; then
BUNDLE_PATH="/${NAME}.bundle"
fi
+PLACE_RESOURCE_BUNDLES_OUTSIDE_FRAMEWORK=${PLACE_RESOURCE_BUNDLES_OUTSIDE_FRAMEWORK:-}
+STATIC_BUNDLE_PATH=
+if [[ ${PLACE_RESOURCE_BUNDLES_OUTSIDE_FRAMEWORK} ]]; then
+ STATIC_BUNDLE_PATH="${OUTPUT}/static${BUNDLE_PATH}"
+else
+ STATIC_BUNDLE_PATH="${OUTPUT}/static/${NAME}.framework${BUNDLE_PATH}"
+fi
+
+STATIC_SETTINGS_DIRECTORY=
+if [[ ${PLACE_RESOURCE_BUNDLES_OUTSIDE_FRAMEWORK} ]]; then
+ STATIC_SETTINGS_DIRECTORY="${OUTPUT}"
+else
+ STATIC_SETTINGS_DIRECTORY="${OUTPUT}/static/${NAME}.framework"
+fi
+
SDK=iphonesimulator
if [[ ${BUILD_FOR_DEVICE} == true ]]; then
SDK=iphoneos
fi
IOS_SDK_VERSION=`xcrun --sdk ${SDK} --show-sdk-version`
-echo "Configuring ${FORMAT:-dynamic and static} ${BUILDTYPE} framework for ${SDK}; symbols: ${GCC_GENERATE_DEBUGGING_SYMBOLS}; Bitcode: ${ENABLE_BITCODE}; Mapbox.bundle: ${BUNDLE_RESOURCES}"
+echo "Configuring ${FORMAT:-dynamic and static} ${BUILDTYPE} framework for ${SDK}; symbols: ${GCC_GENERATE_DEBUGGING_SYMBOLS}; Bitcode: ${ENABLE_BITCODE}; Mapbox.bundle: ${BUNDLE_RESOURCES} bundle.outside: ${PLACE_RESOURCE_BUNDLES_OUTSIDE_FRAMEWORK}"
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
@@ -206,18 +221,19 @@ step "Copying library resources…"
SEM_VERSION=$( git describe --tags --match=ios-v*.*.* --abbrev=0 | sed 's/^ios-v//' )
SHORT_VERSION=${SEM_VERSION%-*}
if [[ ${BUNDLE_RESOURCES} ]]; then
- cp -pv LICENSE.md "${OUTPUT}/static/${NAME}.framework"
- cp -rv platform/ios/app/Settings.bundle "${OUTPUT}/static/${NAME}.framework"
+ cp -pv LICENSE.md ${STATIC_SETTINGS_DIRECTORY}
+ cp -rv platform/ios/app/Settings.bundle ${STATIC_SETTINGS_DIRECTORY}
else
cp -pv LICENSE.md "${OUTPUT}"
cp -rv platform/ios/app/Settings.bundle "${OUTPUT}"
fi
if [[ ${BUILD_STATIC} == true ]]; then
- mkdir -p "${OUTPUT}/static/${NAME}.framework${BUNDLE_PATH}"
- cp -pv platform/{default,ios}/resources/* "${OUTPUT}/static/${NAME}.framework${BUNDLE_PATH}"
+ mkdir -p ${STATIC_BUNDLE_PATH}
+ cp -pv platform/{default,ios}/resources/* ${STATIC_BUNDLE_PATH}
INFO_PLIST_PATH="${OUTPUT}/static/${NAME}.framework/Info.plist"
cp -pv platform/ios/framework/Info.plist "${INFO_PLIST_PATH}"
- plutil -replace CFBundleExecutable -string ${NAME} "${INFO_PLIST_PATH}"
+ plutil -remove CFBundleExecutable "${INFO_PLIST_PATH}"
+ plutil -remove CFBundlePackageType "${INFO_PLIST_PATH}"
plutil -replace CFBundleIdentifier -string com.mapbox.sdk.ios "${INFO_PLIST_PATH}"
plutil -replace CFBundleName -string ${NAME} "${INFO_PLIST_PATH}"
plutil -replace CFBundleShortVersionString -string "${SHORT_VERSION}" "${INFO_PLIST_PATH}"
@@ -225,7 +241,7 @@ if [[ ${BUILD_STATIC} == true ]]; then
plutil -replace MGLSemanticVersionString -string "${SEM_VERSION}" "${INFO_PLIST_PATH}"
plutil -replace MGLCommitHash -string "${HASH}" "${INFO_PLIST_PATH}"
if [[ ${BUNDLE_RESOURCES} ]]; then
- cp -pv "${INFO_PLIST_PATH}" "${OUTPUT}/static/${NAME}.framework${BUNDLE_PATH}/Info.plist"
+ cp -pv "${INFO_PLIST_PATH}" "${STATIC_BUNDLE_PATH}/Info.plist"
fi
mkdir "${OUTPUT}/static/${NAME}.framework/Modules"
cp -pv platform/ios/framework/modulemap "${OUTPUT}/static/${NAME}.framework/Modules/module.modulemap"