-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathcibuild
More file actions
executable file
·77 lines (66 loc) · 2.06 KB
/
cibuild
File metadata and controls
executable file
·77 lines (66 loc) · 2.06 KB
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
77
#!/bin/bash -ex
#
# script/cibuild
# ObjectiveGit
#
# Executes the build and runs tests for Mac and iOS. Designed to be invoked by
# Travis as a matrix build so that the two platform builds can run in parallel.
#
# Dependent tools & scripts:
# - script/bootstrap
# - script/update_libssl_ios
# - [xcodebuild](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html)
# - xcpretty (gem)
# - xcpretty-travis-formatter (gem)
#
# Environment Variables:
# - SCHEME: specifies which Xcode scheme to build. Set to one of the following:
# - ObjectiveGit Mac
# - ObjectiveGit iOS
# - TRAVIS: indicates when the build is being run by travis, used to invoke
# the xcpretty-travis-formatter gem for output.
if [ -z "$SCHEME" ]; then
echo "The SCHEME environment variable is empty. Please set this to one of:"
echo "- ObjectiveGit Mac"
echo "- ObjectiveGit iOS"
exit 1
fi
##
## Configuration Variables
##
set -o pipefail
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
XCWORKSPACE="ObjectiveGitFramework.xcworkspace"
XCODE_OPTIONS=$(RUN_CLANG_STATIC_ANALYZER=NO ONLY_ACTIVE_ARCH=NO CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO)
if [ -n "$TRAVIS" ]; then
# Use a special formatter when running on TravisCI
XCPRETTY_FORMAT_OPTIONS="-f `xcpretty-travis-formatter`"
else
XCPRETTY_FORMAT_OPTIONS="--color"
fi
##
## Build Process
##
echo "*** Bootstrapping..."
"$SCRIPT_DIR/bootstrap"
if [ "$SCHEME" == "ObjectiveGit Mac" ]; then
echo "*** Building and testing $SCHEME..."
echo
xcodebuild -workspace "$XCWORKSPACE" \
-scheme "$SCHEME" \
${XCODE_OPTIONS[*]} \
build test \
2>&1 #| xcpretty $XCPRETTY_FORMAT_OPTIONS
elif [ "$SCHEME" == "ObjectiveGit iOS" ]; then
echo "*** Prebuilding OpenSSL"
"$SCRIPT_DIR/update_libssl_ios"
echo "*** Building and testing $SCHEME..."
echo
xcodebuild -workspace "$XCWORKSPACE" \
-scheme "$SCHEME" \
-destination "platform=iOS Simulator,name=iPhone 11" \
-sdk iphonesimulator \
${XCODE_OPTIONS[*]} \
build test \
2>&1 #| xcpretty $XCPRETTY_FORMAT_OPTIONS
fi