forked from kaltura/playkit-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-build.sh
executable file
·53 lines (44 loc) · 1.3 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
51
52
53
#!/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 TestApp
pod install
CODE=0
xcodebuild clean build -workspace TestApp.xcworkspace -scheme TestApp_v4_2 ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,name=iPhone 11' | tee xcodebuild.log | xcpretty -r html || CODE=$?
xcodebuild clean build -workspace TestApp.xcworkspace -scheme TestApp_v5 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 [ "$TRAVIS_EVENT_TYPE" == "cron" ] || [ -n "$TRAVIS_TAG" ]; then
# Full build at night and tags
keepAlive $FLAG &
libLint
else
# Else just build the test app
buildiOSApp
buildtvOSApp
fi
rm $FLAG # stop keepAlive