summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-10-02 19:07:14 -0400
committerJason Wray <jason@mapbox.com>2018-10-03 13:32:13 -0400
commit228d1a7eb5f06ad82c0fdc2495eed9aa65c3fb6d (patch)
treeecc686f41885c613de4c788a0bcc28c1ad627479
parentcaa2c6d9becd3f9f0720501acdb48418c5ae5033 (diff)
downloadqtlocation-mapboxgl-228d1a7eb5f06ad82c0fdc2495eed9aa65c3fb6d.tar.gz
[ios, build] Check symbol namespacing for mapbox-events-ios
-rw-r--r--Makefile4
-rw-r--r--circle.yml3
-rwxr-xr-xplatform/ios/scripts/check-events-symbols.sh37
3 files changed, 44 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index cff9a28e8d..02ed977f0e 100644
--- a/Makefile
+++ b/Makefile
@@ -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