summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-12-22 16:40:03 -0800
committerMinh Nguyễn <mxn@1ec5.org>2018-01-05 06:39:26 +0000
commit4f194ab15c09cf17edd51c5377fd8ce62ee26879 (patch)
treeb3e6aa0662adc16f24e1992af7dc6ec44e6aa7f8
parent9c9ad538f8f097f19837cdbe4865ced8ba19e81e (diff)
downloadqtlocation-mapboxgl-4f194ab15c09cf17edd51c5377fd8ce62ee26879.tar.gz
[macos] Fixed macosapp deployment
-rwxr-xr-xplatform/macos/scripts/deploy-packages.sh45
-rwxr-xr-xplatform/macos/scripts/package.sh39
2 files changed, 53 insertions, 31 deletions
diff --git a/platform/macos/scripts/deploy-packages.sh b/platform/macos/scripts/deploy-packages.sh
index 90c3c29308..0d053aef4b 100755
--- a/platform/macos/scripts/deploy-packages.sh
+++ b/platform/macos/scripts/deploy-packages.sh
@@ -19,20 +19,31 @@ function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
trap finish EXIT
-buildPackageStyle() {
- local package=$1 style=""
- if [[ ${#} -eq 2 ]]; then
- style="$2"
- fi
- step "Building: make ${package} ${style}"
- make ${package}
- step "Publishing ${package} with ${style}"
+publish() {
+ OPTRESET=1
+ OPTIND=
+ local arg
+ local rule=
+ local suffix=
+ local app=
+ while getopts 'r:s:a:' arg; do
+ case ${arg} in
+ r) rule=${OPTARG};;
+ s) suffix=${OPTARG};;
+ a) app=${OPTARG};;
+ *) "Usage: [-r rule] [-s suffix] [-a app]"; return
+ esac
+ done
+
+ step "Building: make ${rule} ${suffix}"
+ make ${rule}
+ step "Publishing ${rule} with ${suffix}"
local file_name=""
- if [ -z ${style} ]
+ if [ -z ${suffix} ]
then
file_name=mapbox-macos-sdk-${PUBLISH_VERSION}.zip
else
- file_name=mapbox-macos-sdk-${PUBLISH_VERSION}-${style}.zip
+ file_name=mapbox-macos-sdk-${PUBLISH_VERSION}-${suffix}.zip
fi
step "Compressing ${file_name}…"
cd build/macos/pkg
@@ -46,16 +57,18 @@ buildPackageStyle() {
--name ${file_name} \
--file "${BINARY_DIRECTORY}/${file_name}" > /dev/null
fi
- if [[ ${DEPLOY_APP} == true ]]; then
+ if [ ${app} ]; then
+ file_name="Mapbox GL.app.zip"
+ step "Compressing ${file_name}…"
cd build/macos/app
- rm -f 'Mapbox GL.app.zip'
- zip -yr '../deploy/Mapbox GL.app.zip' 'Mapbox GL.app'
+ rm -f "${file_name}"
+ zip -yr "../deploy/${file_name}" 'Mapbox GL.app'
cd -
if [[ "${GITHUB_RELEASE}" == true ]]; then
echo "Uploading ${file_name} to GitHub"
github-release upload \
--tag "macos-v${PUBLISH_VERSION}" \
- --name ${file_name} \
+ --name "${file_name}" \
--file "${BINARY_DIRECTORY}/${file_name}" > /dev/null
fi
fi
@@ -126,7 +139,7 @@ if [[ "${GITHUB_RELEASE}" == true ]]; then
--draft ${PUBLISH_PRE_FLAG}
fi
-buildPackageStyle "xpackage" "symbols"
-DEPLOY_APP=true buildPackageStyle "xpackage SYMBOLS=NO"
+publish -r xpackage -s symbols
+publish -r "xpackage SYMBOLS=NO" -a true
step "Finished deploying ${PUBLISH_VERSION} in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds"
diff --git a/platform/macos/scripts/package.sh b/platform/macos/scripts/package.sh
index a5aae24e0c..6a04b4b948 100755
--- a/platform/macos/scripts/package.sh
+++ b/platform/macos/scripts/package.sh
@@ -8,10 +8,10 @@ NAME=Mapbox
OUTPUT=build/macos/pkg
APP_OUTPUT=build/macos/app
DERIVED_DATA=build/macos
-PRODUCTS=${DERIVED_DATA}
BUILDTYPE=${BUILDTYPE:-Release}
SYMBOLS=${SYMBOLS:-YES}
+PRODUCTS=${DERIVED_DATA}/${BUILDTYPE}
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
@@ -24,15 +24,7 @@ PROJ_VERSION=$(git rev-list --count HEAD)
SEM_VERSION=$( git describe --tags --match=macos-v*.*.* --abbrev=0 | sed 's/^macos-v//' )
SHORT_VERSION=${SEM_VERSION%-*}
-XCODEBUILD_SCHEME=dynamic
-XCODEBUILD_ACTION=build
-if [[ ${BUILDTYPE} == Release ]]; then
- XCODEBUILD_SCHEME=macosapp
- XCODEBUILD_ACTION=archive
- mkdir -p ${APP_OUTPUT}
-fi
-
-step "Building targets (build ${PROJ_VERSION}, version ${SEM_VERSION})…"
+step "Building dynamic framework (build ${PROJ_VERSION}, version ${SEM_VERSION})…"
xcodebuild \
CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
CURRENT_SHORT_VERSION=${SHORT_VERSION} \
@@ -41,16 +33,33 @@ xcodebuild \
-derivedDataPath ${DERIVED_DATA} \
-archivePath "${APP_OUTPUT}/macosapp.xcarchive" \
-workspace ./platform/macos/macos.xcworkspace \
- -scheme ${XCODEBUILD_SCHEME} \
+ -scheme dynamic \
-configuration ${BUILDTYPE} \
-jobs ${JOBS} \
- ${XCODEBUILD_ACTION} | xcpretty
+ build | xcpretty
step "Copying dynamic framework into place"
mkdir -p "${OUTPUT}/${NAME}.framework"
-ditto ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework "${OUTPUT}/${NAME}.framework"
-if [[ -e ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework.dSYM ]]; then
- cp -r ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework.dSYM "${OUTPUT}"
+ditto ${PRODUCTS}/${NAME}.framework "${OUTPUT}/${NAME}.framework"
+if [[ -e ${PRODUCTS}/${NAME}.framework.dSYM ]]; then
+ cp -r ${PRODUCTS}/${NAME}.framework.dSYM "${OUTPUT}"
+fi
+
+step "Building and archiving Mapbox GL.app (build ${PROJ_VERSION}, version ${SEM_VERSION})…"
+if [[ ${BUILDTYPE} == Release ]]; then
+ mkdir -p ${APP_OUTPUT}
+ xcodebuild \
+ CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
+ CURRENT_SHORT_VERSION=${SHORT_VERSION} \
+ CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
+ CURRENT_COMMIT_HASH=${HASH} \
+ -derivedDataPath ${DERIVED_DATA} \
+ -archivePath "${APP_OUTPUT}/macosapp.xcarchive" \
+ -workspace ./platform/macos/macos.xcworkspace \
+ -scheme macosapp \
+ -configuration ${BUILDTYPE} \
+ -jobs ${JOBS} \
+ archive | xcpretty
fi
if [[ ${SYMBOLS} = NO ]]; then