Skip to content

Commit e5b7593

Browse files
committed
Add xcpretty option
1 parent 8b95085 commit e5b7593

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

TemplateProject/scripts/makedist-mac.sh

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
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

55
BASEDIR=$(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+
715
cd $BASEDIR/..
816

917
if [ -d build-mac ]; then
@@ -154,15 +162,22 @@ fi
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
166181
fi
167182

168183
#---------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)