This repository has been archived by the owner on May 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathframework.sh
executable file
·64 lines (54 loc) · 1.8 KB
/
framework.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
PATH="/bin:/usr/bin:/usr/libexec"
VERSION=`git tag | sort -r | sed -n '1p'`
SDK="7.0"
TARGET="MapView"
FW_NAME="Mapbox"
FW_FOLDER="build/$FW_NAME.framework"
#
# clean old version
#
if [ -d $FW_FOLDER ]; then
echo "Removing old build..."
rm -rf MapView/build
rm -rf build
fi
#
# folder & symlink structure
#
mkdir -p $FW_FOLDER/Versions/A/Headers
mkdir -p $FW_FOLDER/Versions/A/Resources
cd $FW_FOLDER
ln -s Versions/A/Headers Headers
ln -s Versions/A/Resources Resources
cd Versions
ln -s A Current
cd ../../..
#
# Info.plist & version
#
cp -v framework.plist $FW_FOLDER/Versions/A/Resources/Info.plist
PlistBuddy $FW_FOLDER/Versions/A/Resources/Info.plist -c "Set :CFBundleVersion $VERSION"
#
# build static lib variants
#
xcodebuild -project MapView/MapView.xcodeproj -target $TARGET -configuration Debug -sdk iphonesimulator${SDK} ONLY_ACTIVE_ARCH=NO
xcodebuild -project MapView/MapView.xcodeproj -target $TARGET -configuration Debug -sdk iphoneos${SDK} ONLY_ACTIVE_ARCH=NO
xcodebuild -project MapView/MapView.xcodeproj -target $TARGET -configuration Release -sdk iphonesimulator${SDK}
xcodebuild -project MapView/MapView.xcodeproj -target $TARGET -configuration Release -sdk iphoneos${SDK}
#
# make fat binaries
#
lipo -create MapView/build/Debug-iphoneos/lib${FW_NAME}.a MapView/build/Debug-iphonesimulator/lib${FW_NAME}.a -o $FW_FOLDER/${FW_NAME}Debug
lipo -create MapView/build/Release-iphoneos/lib${FW_NAME}.a MapView/build/Release-iphonesimulator/lib${FW_NAME}.a -o $FW_FOLDER/${FW_NAME}
#
# copy headers
#
for header in `ls MapView/Map/*.h | grep -v $FW_NAME.h`; do
cp -v $header $FW_FOLDER/Versions/A/Headers
done
cp -v MapView/Map/$FW_NAME.h $FW_FOLDER/Versions/A/Headers
#
# copy resource bundle
#
cp -r -v MapView/build/Release-iphoneos/$FW_NAME.bundle $FW_FOLDER/Versions/A/Resources