-
Notifications
You must be signed in to change notification settings - Fork 9
/
travis-build.sh
executable file
·50 lines (41 loc) · 1.03 KB
/
travis-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/bash
set -eou pipefail
# Travis aborts the build if it doesn't get output for 10 minutes.
keepAlive() {
while [ -f $1 ]
do
sleep 10
echo .
done
}
buildiOSApp() {
echo Building the iOS test app
cd iOSTestApp
pod install
CODE=0
xcodebuild clean build -workspace iOSTestApp.xcworkspace -scheme iOSTestApp -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone X' | tee xcodebuild.log | xcpretty -r html || CODE=$?
cd ../
export CODE
}
buildtvOSApp() {
echo Building the tvOS test app
cd tvOSTestApp
pod install
CODE=0
xcodebuild clean build -workspace tvOSTestApp.xcworkspace -scheme tvOSTestApp -destination 'platform=tvOS Simulator,name=Apple TV' | tee xcodebuild.log | xcpretty -r html || CODE=$?
cd ../
export CODE
}
libLint() {
echo Linting the pod
pod lib lint --allow-warnings
}
FLAG=$(mktemp)
if [ -n "$TRAVIS_TAG" ] || [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then
keepAlive $FLAG &
libLint
else
buildiOSApp
buildtvOSApp
fi
rm $FLAG # stop keepAlive