forked from stuartervine/OCTotallyLazy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·50 lines (42 loc) · 1.2 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
#!/bin/sh
CURRENT_USER=`whoami`
CURRENT_PATH=`pwd`
XCODE_PATH=`xcode-select -print-path`
function cleanTargets() {
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Application Support/iPhone Simulator
rm -rf build
xcodebuild -target OCTotallyLazy -sdk iphoneos -configuration Release clean;
xcodebuild -target test-unit -sdk $XCODE_PATH/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/ -configuration Debug clean;
}
function runTests() {
#xcodebuild -target package -sdk iphoneos -configuration Release build
xcodebuild -verbose -target test-unit -sdk $XCODE_PATH/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/ -configuration Debug build
OUT=$?
if [ $OUT -ne 0 ]
then
echo "Build FAILED : $OUT";
exit 1
fi
}
function buildRelease() {
xcodebuild -target package -sdk iphoneos -configuration Debug build
OUT=$?
if [ $OUT -ne 0 ]
then
echo "Build FAILED : $OUT";
exit 1
fi
}
case "$1" in
clean)
cleanTargets;;
test)
runTests;;
release)
buildRelease;;
*)
echo "Usage: build.sh (clean|test|release) e.g. ./build.sh test";
exit 1;;
esac
exit 0