summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2016-09-30 16:24:00 -0400
committerJason Wray <friedbunny@users.noreply.github.com>2016-09-30 18:49:05 -0400
commitd7a44a6b902f2bf90766f7c470cf759187193480 (patch)
treee10cc64f373df37591b73d2f3f1469e04fd78232
parent161955209d87599771c0e822d655dd06d1fab069 (diff)
downloadqtlocation-mapboxgl-d7a44a6b902f2bf90766f7c470cf759187193480.tar.gz
[macos][build] Validate dSYM and framework UUIDs
-rwxr-xr-xplatform/macos/scripts/package.sh23
1 files changed, 22 insertions, 1 deletions
diff --git a/platform/macos/scripts/package.sh b/platform/macos/scripts/package.sh
index b777d22be8..9cb38c6c71 100755
--- a/platform/macos/scripts/package.sh
+++ b/platform/macos/scripts/package.sh
@@ -43,10 +43,31 @@ if [[ -e ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework.dSYM ]]; then
fi
if [[ ${SYMBOLS} = NO ]]; then
- step "Stripping binaries…"
+ step "Stripping symbols from binaries"
strip -Sx "${OUTPUT}/${NAME}.framework/${NAME}"
fi
+function get_comparable_uuid {
+ echo $(dwarfdump --uuid ${1} | sed -n 's/.*UUID:\([^\"]*\) .*/\1/p' | sort)
+}
+
+function validate_dsym {
+ step "Validating dSYM and framework UUIDs…"
+ DSYM_UUID=$(get_comparable_uuid "${1}")
+ FRAMEWORK_UUID=$(get_comparable_uuid "${2}")
+ echo -e "${1}\n ${DSYM_UUID}\n${2}\n ${FRAMEWORK_UUID}"
+ if [[ ${DSYM_UUID} != ${FRAMEWORK_UUID} ]]; then
+ echo "Error: dSYM and framework UUIDs do not match."
+ exit 1
+ fi
+}
+
+if [[ ${BUILDTYPE} == Release ]]; then
+ validate_dsym \
+ "${OUTPUT}/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" \
+ "${OUTPUT}/${NAME}.framework/${NAME}"
+fi
+
step "Copying library resources…"
cp -pv LICENSE.md "${OUTPUT}"
cp -pv platform/macos/docs/pod-README.md "${OUTPUT}/README.md"