File tree Expand file tree Collapse file tree 1 file changed +24
-9
lines changed
Expand file tree Collapse file tree 1 file changed +24
-9
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- # this script requires xcpretty https://github.com/xcpretty/xcpretty
3+ # optional: xcpretty https://github.com/xcpretty/xcpretty (pass 'pretty' arg to enable)
44
55BASEDIR=$( dirname $0 )
66
7+ # Check for 'pretty' argument anywhere in args
8+ USE_XCPRETTY=0
9+ for arg in " $@ " ; do
10+ if [ " $arg " == " pretty" ]; then
11+ USE_XCPRETTY=1
12+ fi
13+ done
14+
715cd $BASEDIR /..
816
917if [ -d build-mac ]; then
154162# ---------------------------------------------------------------------------------------------------------
155163# build xcode project. Change target to build individual formats, or add to All target in the xcode project
156164
157- xcodebuild -project ./projects/$PLUGIN_NAME -macOS.xcodeproj -xcconfig ./config/$PLUGIN_NAME -mac.xcconfig DEMO_VERSION=$DEMO -target " All" -configuration Release | tee build-mac.log | xcpretty # && exit ${PIPESTATUS[0]}
158-
159- if [ " ${PIPESTATUS[0]} " -ne " 0" ]; then
160- echo " ERROR: build failed, aborting"
161- echo " "
162- cat build-mac.log
163- exit 1
164- else
165+ if [ " $USE_XCPRETTY " -eq " 1" ]; then
166+ xcodebuild -project ./projects/$PLUGIN_NAME -macOS.xcodeproj -xcconfig ./config/$PLUGIN_NAME -mac.xcconfig DEMO_VERSION=$DEMO -target " All" -configuration Release | tee build-mac.log | xcpretty
167+ BUILD_STATUS=${PIPESTATUS[0]}
168+ if [ " $BUILD_STATUS " -ne " 0" ]; then
169+ echo " ERROR: build failed, aborting"
170+ echo " "
171+ cat build-mac.log
172+ exit 1
173+ fi
165174 rm build-mac.log
175+ else
176+ xcodebuild -project ./projects/$PLUGIN_NAME -macOS.xcodeproj -xcconfig ./config/$PLUGIN_NAME -mac.xcconfig DEMO_VERSION=$DEMO -target " All" -configuration Release
177+ if [ " $? " -ne " 0" ]; then
178+ echo " ERROR: build failed, aborting"
179+ exit 1
180+ fi
166181fi
167182
168183# ---------------------------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments