forked from google/google-api-objectivec-client-for-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.sh
executable file
·76 lines (69 loc) · 1.72 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
set -eu
if [[ "$#" -ne 2 ]]; then
echo "Usage: $0 {iOS|OSX|tvOS} {Debug|Release|Both}"
exit 10
fi
readonly BUILD_MODE="$1"
readonly BUILD_CFG="$2"
# Default to "test", changed via BUILD_MODE below.
XCODEBUILD_ACTION="test"
# Report then run the build
RunXcodeBuild() {
echo xcodebuild "$@"
xcodebuild "$@"
}
case "${BUILD_MODE}" in
iOSCore)
CMD_BUILDER+=(
-project Source/GTLRCore.xcodeproj
-scheme "iOS Framework and Tests"
-destination "platform=iOS Simulator,name=iPhone 6,OS=latest"
)
;;
OSXCore)
CMD_BUILDER+=(
-project Source/GTLRCore.xcodeproj
-scheme "OS X Framework and Tests"
)
;;
tvOSCore)
CMD_BUILDER+=(
-project Source/GTLRCore.xcodeproj
-scheme "tvOS Framework and Tests"
-destination "platform=tvOS Simulator,name=Apple TV 1080p,OS=latest"
)
;;
ServiceGenerator)
CMD_BUILDER+=(
-project "Source/Tools/ServiceGenerator/ServiceGenerator.xcodeproj"
-scheme "ServiceGenerator"
)
XCODEBUILD_ACTION="build"
;;
Example_*)
EXAMPLE_NAME="${BUILD_MODE/Example_/}"
CMD_BUILDER+=(
-project "Examples/${EXAMPLE_NAME}/${EXAMPLE_NAME}.xcodeproj"
-scheme "${EXAMPLE_NAME}"
)
XCODEBUILD_ACTION="build"
;;
*)
echo "Unknown BUILD_MODE: ${BUILD_MODE}"
exit 11
;;
esac
case "${BUILD_CFG}" in
Debug|Release)
RunXcodeBuild "${CMD_BUILDER[@]}" -configuration "${BUILD_CFG}" "${XCODEBUILD_ACTION}"
;;
Both)
RunXcodeBuild "${CMD_BUILDER[@]}" -configuration Debug "${XCODEBUILD_ACTION}"
RunXcodeBuild "${CMD_BUILDER[@]}" -configuration Release "${XCODEBUILD_ACTION}"
;;
*)
echo "Unknown BUILD_CFG: ${BUILD_CFG}"
exit 12
;;
esac