diff options
author | Jason Wray <jason@mapbox.com> | 2018-10-02 19:07:14 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2018-10-03 13:32:13 -0400 |
commit | 228d1a7eb5f06ad82c0fdc2495eed9aa65c3fb6d (patch) | |
tree | ecc686f41885c613de4c788a0bcc28c1ad627479 | |
parent | caa2c6d9becd3f9f0720501acdb48418c5ae5033 (diff) | |
download | qtlocation-mapboxgl-228d1a7eb5f06ad82c0fdc2495eed9aa65c3fb6d.tar.gz |
[ios, build] Check symbol namespacing for mapbox-events-ios
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | circle.yml | 3 | ||||
-rwxr-xr-x | platform/ios/scripts/check-events-symbols.sh | 37 |
3 files changed, 44 insertions, 0 deletions
@@ -252,6 +252,10 @@ ios-sanitize-address: $(IOS_PROJ_PATH) ios-static-analyzer: $(IOS_PROJ_PATH) set -o pipefail && $(IOS_XCODEBUILD_SIM) analyze -scheme 'CI' test $(XCPRETTY) +.PHONY: ios-check-events-symbols +ios-check-events-symbols: + ./platform/ios/scripts/check-events-symbols.sh + .PHONY: ipackage ipackage: ipackage* ipackage%: diff --git a/circle.yml b/circle.yml index 1def734e60..087418de3d 100644 --- a/circle.yml +++ b/circle.yml @@ -851,6 +851,9 @@ jobs: - build-ios-integration-test - check-public-symbols - run: + name: Check symbol namespacing for mapbox-events-ios + command: make ios-check-events-symbols + - run: name: Lint plist files command: make ios-lint - run: diff --git a/platform/ios/scripts/check-events-symbols.sh b/platform/ios/scripts/check-events-symbols.sh new file mode 100755 index 0000000000..c76d5e2693 --- /dev/null +++ b/platform/ios/scripts/check-events-symbols.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -eu -o pipefail + +function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } +function finish { >&2 echo -en "\033[0m"; } +trap finish EXIT + +find_framework() { + step "Looking for Mapbox.framework…" + echo $( find ./build -name Mapbox | tail -n 1 ) +} + +FRAMEWORK=$(find_framework) + +if [[ -z "${FRAMEWORK}" || ! -f "${FRAMEWORK}" ]]; then + echo "No framework found — building dynamic Mapbox.framework…" + make iframework BUILD_DEVICE=false + FRAMEWORK=$(find_framework) +fi + +echo "Found framework: ${FRAMEWORK}" + +step "Checking for un-namespaced symbols from mapbox-events-ios…" + +# Symbols from mapbox-events-ios are prefixed MME. To avoid duplicate symbol +# warnings when multiple copes of mapbox-events-ios are included in a project, +# the maps SDK prefixes these symbols with MGL_. +SYMBOLS=$( nm "$FRAMEWORK" | grep \$_MME || true ) + +if [ -z "${SYMBOLS}" ]; then + echo "✅ No un-namespaced symbols found." +else + echo "❗️ Found un-namespaced symbols:" + echo "${SYMBOLS}" + exit 1 +fi |