forked from iZettle/Lift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
76 lines (62 loc) · 1.31 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
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
set -o errexit
set -o errtrace
set -o pipefail
PROJECT="Lift.xcodeproj"
SCHEME="Lift"
IOS_SDK="iphonesimulator11.1"
IOS_DESTINATION="OS=11.1,name=iPhone 8"
usage() {
cat << EOF
Usage: sh $0 command
[Building]
iOS Build iOS framework
native Build using `swift build`
clean Clean up all un-neccesary files
[Testing]
test-iOS Run tests on iOS host
test-native Run tests using `swift test`
EOF
}
COMMAND="$1"
case "$COMMAND" in
"clean")
find . -type d -name build -exec rm -r "{}" +\;
exit 0;
;;
"iOS" | "ios")
xcodebuild clean \
-project $PROJECT \
-scheme "${SCHEME}" \
-sdk "${IOS_SDK}" \
-destination "${IOS_DESTINATION}" \
-configuration Debug ONLY_ACTIVE_ARCH=YES \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO \
build | xcpretty -c
exit 0;
;;
"native" | "")
swift build
exit 0;
;;
"test-iOS" | "test-ios")
xcodebuild clean \
-project $PROJECT \
-scheme "${SCHEME}" \
-sdk "${IOS_SDK}" \
-destination "${IOS_DESTINATION}" \
-configuration Release \
ONLY_ACTIVE_ARCH=YES \
CODE_SIGNING_REQUIRED=NO \
ENABLE_TESTABILITY=YES \
build test | xcpretty -c
exit 0;
;;
"test-native")
swift package clean
swift build
swift test
exit 0;
;;
esac
usage