Skip to content

Commit 517e28d

Browse files
committed
Merge pull request #487 from NativeScript/fealebenpae/xcpretty-logging
Pipe build logs through XCPretty
2 parents 7a20627 + e4fdd08 commit 517e28d

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

build/scripts/build.sh

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@ set -e
44

55
WORKSPACE=`pwd`
66

7+
function xcodebuild_pretty {
8+
XCFORMATTER=true
9+
if hash xcpretty 2>/dev/null; then
10+
XCFORMATTER=xcpretty
11+
fi
12+
set -o pipefail && xcodebuild "$@" 2>&1 | tee -a "$WORKSPACE/build.log" | $XCFORMATTER
13+
}
14+
715
CMAKE_FLAGS="-G Xcode -DCMAKE_INSTALL_PREFIX=$WORKSPACE/dist"
816

917
mkdir -p "$WORKSPACE/cmake-build"
1018
cd "$WORKSPACE/cmake-build"
1119

1220
echo "Building NativeScript.framework..."
1321
rm -f CMakeCache.txt
14-
echo "\tConfiguring..."
15-
cmake .. $CMAKE_FLAGS -DBUILD_SHARED_LIBS=ON > "$WORKSPACE/build.log" 2>&1
16-
echo "\tiPhoneOS..."
17-
xcodebuild -configuration Release -sdk iphoneos -target NativeScript >> "$WORKSPACE/build.log" 2>&1
18-
echo "\tiPhoneSimulator..."
19-
xcodebuild -configuration Release -sdk iphonesimulator -target NativeScript >> "$WORKSPACE/build.log" 2>&1
22+
rm -f "$WORKSPACE/build.log"
23+
echo -e "\tConfiguring..."
24+
cmake .. $CMAKE_FLAGS -DBUILD_SHARED_LIBS=ON 2>&1 | tee -a "$WORKSPACE/build.log"
25+
echo -e "\tiPhoneOS..."
26+
xcodebuild_pretty -configuration Release -sdk iphoneos -target NativeScript
27+
echo -e "\tiPhoneSimulator..."
28+
xcodebuild_pretty -configuration Release -sdk iphonesimulator -target NativeScript
2029

2130
echo "Packaging NativeScript.framework..."
2231
mkdir -p "$WORKSPACE/dist"
@@ -29,12 +38,12 @@ lipo -create -output "$WORKSPACE/dist/NativeScript.framework/NativeScript" \
2938

3039
echo "Building libNativeScript..."
3140
rm -f CMakeCache.txt
32-
echo "\tConfiguring..."
33-
cmake .. $CMAKE_FLAGS -DEMBED_STATIC_DEPENDENCIES=ON >> "$WORKSPACE/build.log"
34-
echo "\tiPhoneOS..."
35-
xcodebuild -configuration Release -sdk iphoneos -target NativeScript >> "$WORKSPACE/build.log" 2>&1
36-
echo "\tiPhoneSimulator..."
37-
xcodebuild -configuration Release -sdk iphonesimulator -target NativeScript >> "$WORKSPACE/build.log" 2>&1
41+
echo -e "\tConfiguring..."
42+
cmake .. $CMAKE_FLAGS -DEMBED_STATIC_DEPENDENCIES=ON 2>&1 | tee -a "$WORKSPACE/build.log"
43+
echo -e "\tiPhoneOS..."
44+
xcodebuild_pretty -configuration Release -sdk iphoneos -target NativeScript
45+
echo -e "\tiPhoneSimulator..."
46+
xcodebuild_pretty -configuration Release -sdk iphonesimulator -target NativeScript
3847

3948
echo "Packaging libNativeScript..."
4049
mkdir -p "$WORKSPACE/dist/NativeScript/lib"
@@ -52,13 +61,13 @@ cp \
5261
"$WORKSPACE/dist/NativeScript/include"
5362

5463
echo "Building objc-metadata-generator..."
55-
xcodebuild -configuration Release -target MetadataGenerator >> "$WORKSPACE/build.log" 2>&1
64+
xcodebuild_pretty -configuration Release -target MetadataGenerator
5665
echo "Packaging objc-metadata-generator..."
5766
cp -R "$WORKSPACE/cmake-build/metadataGenerator" "$WORKSPACE/dist/"
5867
cp "$WORKSPACE/build/scripts/metadata-generation-build-step" "$WORKSPACE/dist/metadataGenerator/bin/"
5968

6069
echo "Building Gameraww..."
61-
xcodebuild -configuration Release -sdk iphoneos -target Gameraww >> "$WORKSPACE/build.log" 2>&1
70+
xcodebuild_pretty -configuration Release -sdk iphoneos -target Gameraww
6271
echo "Packaging Gameraww..."
6372
xcrun -sdk iphoneos PackageApplication -v "$WORKSPACE/cmake-build/examples/Gameraww/Release-iphoneos/Gameraww.app" \
6473
-o "$WORKSPACE/cmake-build/examples/Gameraww/Release-iphoneos/Gameraww.ipa" \
@@ -68,8 +77,8 @@ echo "TNS_IPA_SIZE: "$GAMERAWW_IPA_SIZE"KB"
6877
echo "TNS_IPA_SIZE_KB\\n"$GAMERAWW_IPA_SIZE > "$WORKSPACE/build-stats.csv"
6978

7079
echo "Building TestRunner..."
71-
xcodebuild -configuration Debug -sdk iphoneos -target TestRunner ARCHS="armv7" ONLY_ACTIVE_ARCH=NO >> "$WORKSPACE/build.log" 2>&1
80+
xcodebuild_pretty -configuration Debug -sdk iphoneos -target TestRunner ARCHS="armv7" ONLY_ACTIVE_ARCH=NO
7281
echo "Packaging TestRunner..."
7382
xcrun -sdk iphoneos PackageApplication -v "$WORKSPACE/cmake-build/tests/TestRunner/Debug-iphoneos/TestRunner.app" \
7483
-o "$WORKSPACE/cmake-build/tests/TestRunner/Debug-iphoneos/TestRunner.ipa" \
75-
>> "$WORKSPACE/build.log" 2>&1
84+
>> "$WORKSPACE/build.log" 2>&1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
xcodebuild -target JavaScriptCore -sdk "$SDKROOT" -configuration $CONFIGURATION ARCHS="$ARCHS" ONLY_ACTIVE_ARCH=$ONLY_ACTIVE_ARCH $DEPLOYMENT_TARGET_SETTING_NAME=${!DEPLOYMENT_TARGET_CLANG_ENV_NAME}
3+
xcodebuild -target JavaScriptCore -sdk "$SDKROOT" -configuration $CONFIGURATION ARCHS="$ARCHS" ONLY_ACTIVE_ARCH=$ONLY_ACTIVE_ARCH $DEPLOYMENT_TARGET_SETTING_NAME=${!DEPLOYMENT_TARGET_CLANG_ENV_NAME} GCC_WARN_INHIBIT_ALL_WARNINGS=YES

0 commit comments

Comments
 (0)