diff options
author | Jason Wray <jason@mapbox.com> | 2018-10-02 19:07:14 -0400 |
---|---|---|
committer | Jason Wray <friedbunny@users.noreply.github.com> | 2018-10-03 13:26:59 -0400 |
commit | 360a36771b20fdcad913d0a6f228d92aa9cb3c1b (patch) | |
tree | e47df97b3b50dc3fc90c1c783dab56f37912254e /platform | |
parent | 1fe29b284f25da621d3587fa766b2e66f378eb7d (diff) | |
download | qtlocation-mapboxgl-360a36771b20fdcad913d0a6f228d92aa9cb3c1b.tar.gz |
[ios, build] Check symbol namespacing for mapbox-events-ios
Diffstat (limited to 'platform')
-rwxr-xr-x | platform/ios/scripts/check-events-symbols.sh | 37 |
1 files changed, 37 insertions, 0 deletions
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 |