summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ios/framework.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/ios/framework.sh b/scripts/ios/framework.sh
new file mode 100755
index 0000000000..700c8cf5ac
--- /dev/null
+++ b/scripts/ios/framework.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+set -u
+
+cd build/ios/pkg
+rm -rf framework
+mkdir framework
+cd framework
+
+mkdir Mapbox.framework
+
+# headers
+cp -rv ../static/Headers Mapbox.framework/Headers
+cat ../../../../ios/framework/umbrella >> Mapbox.framework/Headers/Mapbox.h
+
+# resources
+cp -rv ../static/Mapbox.bundle Mapbox.framework/Mapbox.bundle
+
+# binary
+cp -v ../static/libMapbox.a Mapbox.framework/Mapbox
+
+# module map
+mkdir Mapbox.framework/Modules
+cp -v ../../../../ios/framework/modulemap Mapbox.framework/Modules/module.modulemap
+
+# Info.plist
+VERSION=$( git tag | grep ^ios | sed 's/^ios-//' | sort -r | grep -v '\-rc.' | grep -v '\-pre.' | sed -n '1p' | sed 's/^v//' )
+cp -v ../../../../ios/framework/Info.plist Mapbox.framework
+perl -pi -e "s/#####/$VERSION/" Mapbox.framework/Info.plist
+perl -pi -e "s/%%%%%/$VERSION/" Mapbox.framework/Info.plist