-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.sh
executable file
·50 lines (43 loc) · 1.14 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`
SDK_PATH=`ls -t -d $XCODE_PATH/Platforms/iPhoneSimulator.platform/Developer/SDKs/* | head -1`
function cleanTargets() {
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Application Support/iPhone Simulator
rm -rf build
xctool -target OCTotallyLazy -sdk iphoneos -configuration Release clean;
xctool -target OCTotallyLazyTests -sdk iphoneos -configuration Debug clean;
}
function runTests() {
#xcodebuild -target OCTotallyLazy -sdk iphoneos -configuration Release build
xctool -scheme AllTests -sdk iphonesimulator -configuration Debug test
OUT=$?
if [ $OUT -ne 0 ]
then
echo "Build FAILED : $OUT";
exit 1
fi
}
function buildRelease() {
xctool -scheme OCTotallyLazy -sdk iphoneos -configuration Release 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