File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 108
108
function RunXcodebuild() {
109
109
echo xcodebuild " $@ "
110
110
111
- xcodebuild " $@ " | xcpretty; result=$?
111
+ xcpretty_cmd=(xcpretty)
112
+ if [[ -n " ${TRAVIS:- } " ]]; then
113
+ # The formatter argument takes a file location of a formatter.
114
+ # The xcpretty-travis-formatter binary prints its location on stdout.
115
+ xcpretty_cmd+=(-f $( xcpretty-travis-formatter) )
116
+ fi
117
+
118
+ xcodebuild " $@ " | tee xcodebuild.log | " ${xcpretty_cmd[@]} " ; result=$?
112
119
if [[ $result == 65 ]]; then
113
120
echo " xcodebuild exited with 65, retrying" 1>&2
114
121
sleep 5
115
122
116
- xcodebuild " $@ " | xcpretty ; result=$?
123
+ xcodebuild " $@ " | tee xcodebuild.log | " ${xcpretty_cmd[@]} " ; result=$?
117
124
fi
118
125
if [[ $result != 0 ]]; then
126
+ echo " xcodebuild exited with $result ; raw log follows" 1>&2
127
+ cat xcodebuild.log
119
128
exit $result
120
129
fi
121
130
}
Original file line number Diff line number Diff line change @@ -68,6 +68,13 @@ function apt_install() {
68
68
which " $program " >& /dev/null || sudo apt-get install " $package "
69
69
}
70
70
71
+ function install_xcpretty() {
72
+ gem install xcpretty
73
+ if [[ -n " ${TRAVIS:- } " ]]; then
74
+ gem install xcpretty-travis-formatter
75
+ fi
76
+ }
77
+
71
78
secrets_installed=false
72
79
73
80
# Default values, if not supplied on the command line or environment
106
113
case " $project -$platform -$method " in
107
114
108
115
FirebasePod-iOS-xcodebuild)
109
- gem install xcpretty
116
+ install_xcpretty
110
117
bundle exec pod install --project-directory=CoreOnly/Tests/FirebasePodTest --repo-update
111
118
;;
112
119
113
120
Auth-* )
114
121
# Install the workspace for integration testing.
115
- gem install xcpretty
122
+ install_xcpretty
116
123
bundle exec pod install --project-directory=Example/Auth/AuthSample --repo-update
117
124
;;
118
125
@@ -139,12 +146,12 @@ case "$project-$platform-$method" in
139
146
;;
140
147
141
148
InAppMessaging-* -xcodebuild)
142
- gem install xcpretty
149
+ install_xcpretty
143
150
bundle exec pod install --project-directory=FirebaseInAppMessaging/Tests/Integration/DefaultUITestApp --no-repo-update
144
151
;;
145
152
146
153
Firestore-* -xcodebuild | Firestore-* -fuzz)
147
- gem install xcpretty
154
+ install_xcpretty
148
155
149
156
# The Firestore Podfile is multi-platform by default, but this doesn't work
150
157
# with command-line builds using xcodebuild. The PLATFORM environment
@@ -174,7 +181,7 @@ case "$project-$platform-$method" in
174
181
;;
175
182
176
183
SymbolCollision-* -xcodebuild)
177
- gem install xcpretty
184
+ install_xcpretty
178
185
bundle exec pod install --project-directory=SymbolCollisionTest --repo-update
179
186
;;
180
187
You can’t perform that action at this time.
0 commit comments