forked from wrld3d/wrld-example-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·66 lines (55 loc) · 1.19 KB
/
build.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
65
66
#!/bin/sh
allArguments=$@
usage() { echo "Usage: $0 -p android|ios"; echo " -p -> platform, ios or android (required)"; 1>&2; exit 1; }
while getopts "p:" o; do
case "${o}" in
p)
p=${OPTARG}
if [ "$p" != "ios" ]; then
if [ "$p" != "android" ]; then
usage
fi
fi
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${p}" ]; then
usage
fi
if [ $p == "ios" ]; then
echo "Building iOS examples..."
rm -rf "./ios/Include/eegeo"
rm -rf "./ios/build"
./update.platform.sh $allArguments
if [ $? -ne 0 ] ; then
exit $?
fi
pushd ios
./build.sh $allArguments
resultcode=$?
popd
elif [ $p == "android" ]; then
echo "Building Android examples..."
rm -rf "./android/libs/eegeo"
rm -rf "./android/obj"
rm -rf "./android/bin"
./update.platform.sh $allArguments
if [ $? -ne 0 ] ; then
exit $?
fi
pushd android
./build.sh $allArguments
resultcode=$?
popd
fi
if [ $resultcode = 0 ] ; then
echo "BUILD SUCCEEDED"
exit
else
echo "BUILD FAILED"
fi
exit $resultcode