forked from google/gtm-session-fetcher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.sh
executable file
·57 lines (50 loc) · 1.09 KB
/
.travis.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
#!/usr/bin/env bash
set -eu
if [[ "$#" -ne 2 ]]; then
echo "Usage: $0 {iOS|OSX|tvOS} {Debug|Release|Both}"
exit 10
fi
BUILD_MODE="$1"
BUILD_CFG="$2"
# Report then run the build
RunXcodeBuild() {
echo xcodebuild "$@"
xcodebuild "$@"
}
CMD_BUILDER=(
-project Source/GTMSessionFetcherCore.xcodeproj
)
case "${BUILD_MODE}" in
iOS)
CMD_BUILDER+=(
-scheme "iOS Framework"
-destination "platform=iOS Simulator,name=iPhone 6,OS=latest"
)
;;
OSX)
CMD_BUILDER+=(-scheme "OS X Framework")
;;
tvOS)
CMD_BUILDER+=(
-scheme "tvOS Framework"
-destination "platform=tvOS Simulator,name=Apple TV 1080p,OS=latest"
)
;;
*)
echo "Unknown BUILD_MODE: ${BUILD_MODE}"
exit 11
;;
esac
case "${BUILD_CFG}" in
Debug|Release)
RunXcodeBuild "${CMD_BUILDER[@]}" -configuration "${BUILD_CFG}" build test
;;
Both)
RunXcodeBuild "${CMD_BUILDER[@]}" -configuration Debug build test
RunXcodeBuild "${CMD_BUILDER[@]}" -configuration Release build test
;;
*)
echo "Unknown BUILD_CFG: ${BUILD_CFG}"
exit 12
;;
esac