summaryrefslogtreecommitdiff
path: root/scripts/ios/framework.sh
blob: 700c8cf5aca623ce5a168f10181391d26358a60b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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