-
Notifications
You must be signed in to change notification settings - Fork 28
/
build_dist
executable file
·81 lines (63 loc) · 1.69 KB
/
build_dist
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
AR_ENV_PATH=.
NAME=SGAREnvironment
VERSION=0.3.8
AR_ENV_DIR=$AR_ENV_PATH/$NAME-v$VERSION
RESOURCE_PATH=Resources
IMAGE_PATH=$RESOURCE_PATH/Images
AR_ENV_IMAGE_DIR=$AR_ENV_DIR/Images
HEADER_DIR=$AR_ENV_DIR/Headers
LIBRARY_NAME=lib$NAME.a
SIM_LIBRARY_NAME=lib$NAME-sim.a
LIBRARY_PATH=build/Release-iphoneos/$LIBRARY_NAME
SIM_LIBRARY_PATH=build/Release-iphonesimulator/$LIBRARY_NAME
ROOT_HEADER_PATH=./Classes
HEADER_DOC_DIR=Resources/HeaderDoc
DOC_DIR=$AR_ENV_DIR/Documentation
CSS_DIR=$DOC_DIR/css
rm -rf $AR_ENV_DIR
mkdir $AR_ENV_DIR $AR_ENV_DIR/iphoneos $AR_ENV_DIR/iphonesimulator $DOC_DIR $HEADER_DIR $CSS_DIR
HEADER_FILES=$(find $ROOT_HEADER_PATH -name "*.h")
for header_file in $HEADER_FILES
do
echo Copying $header_file
cp $header_file $HEADER_DIR/
done
if [ $1 ]; then
SDK_VERSION=$1
else
SDK_VERSION=4.1
fi
SDKs=( iphoneos$SDK_VERSION iphonesimulator$SDK_VERSION )
for sdk in ${SDKs[@]}
do
xcodebuild -target $NAME -sdk $sdk clean build
if [ $? -gt 0 ]; then
echo "ERROR!"
exit
fi
done
# Static Libraries
cp $LIBRARY_PATH $AR_ENV_DIR/iphoneos/$LIBRARY_NAME
cp $SIM_LIBRARY_PATH $AR_ENV_DIR/iphonesimulator/$LIBRARY_NAME
# Produce HeaderDocs
cp -r $HEADER_DOC_DIR/Images $DOC_DIR
cp $HEADER_DOC_DIR/Documentation.config headerDoc2HTML.config
cp $HEADER_DOC_DIR/SDK.hdoc $AR_ENV_DIR/this.hdoc
cp $HEADER_DOC_DIR/TOCmaster.css $CSS_DIR
headerdoc2HTML -H -o $DOC_DIR $HEADER_DIR
gatherheaderdoc $DOC_DIR $NAME.html
rm headerDoc2HTML.config
rm $AR_ENV_DIR/this.hdoc
cp README $AR_ENV_DIR
cp LICENSE $AR_ENV_DIR
# Copy images
mkdir $AR_ENV_IMAGE_DIR
cp -r $IMAGE_PATH/SG*.png $AR_ENV_IMAGE_DIR
for i in $*
do
case $i in
--zip)
zip -r $AR_ENV_DIR.zip $AR_ENV_DIR
esac
done