-
Notifications
You must be signed in to change notification settings - Fork 5
/
travis-build.sh
executable file
·50 lines (41 loc) · 1.04 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 TestApp
cd iOSTestApp
pod install
CODE=0
xcodebuild clean build -workspace iOSTestApp.xcworkspace -scheme iOSTestApp ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone 11' | tee xcodebuild.log | xcpretty -r html || CODE=$?
cd ../
export CODE
}
buildtvOSApp() {
echo Building the tvOS TestApp
cd tvOSTestApp
pod install
CODE=0
xcodebuild clean build -workspace tvOSTestApp.xcworkspace -scheme tvOSTestApp ONLY_ACTIVE_ARCH=NO -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 --fail-fast --allow-warnings
}
FLAG=$(mktemp)
if [ -n "$TRAVIS_TAG" ] || [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then
keepAlive $FLAG &
libLint
else
buildiOSApp
buildtvOSApp
fi
rm $FLAG # stop keepAlive