4
4
5
5
WORKSPACE=` pwd`
6
6
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
+
7
15
CMAKE_FLAGS=" -G Xcode -DCMAKE_INSTALL_PREFIX=$WORKSPACE /dist"
8
16
9
17
mkdir -p " $WORKSPACE /cmake-build"
10
18
cd " $WORKSPACE /cmake-build"
11
19
12
20
echo " Building NativeScript.framework..."
13
21
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
20
29
21
30
echo " Packaging NativeScript.framework..."
22
31
mkdir -p " $WORKSPACE /dist"
@@ -29,12 +38,12 @@ lipo -create -output "$WORKSPACE/dist/NativeScript.framework/NativeScript" \
29
38
30
39
echo " Building libNativeScript..."
31
40
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
38
47
39
48
echo " Packaging libNativeScript..."
40
49
mkdir -p " $WORKSPACE /dist/NativeScript/lib"
52
61
" $WORKSPACE /dist/NativeScript/include"
53
62
54
63
echo " Building objc-metadata-generator..."
55
- xcodebuild -configuration Release -target MetadataGenerator >> " $WORKSPACE /build.log " 2>&1
64
+ xcodebuild_pretty -configuration Release -target MetadataGenerator
56
65
echo " Packaging objc-metadata-generator..."
57
66
cp -R " $WORKSPACE /cmake-build/metadataGenerator" " $WORKSPACE /dist/"
58
67
cp " $WORKSPACE /build/scripts/metadata-generation-build-step" " $WORKSPACE /dist/metadataGenerator/bin/"
59
68
60
69
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
62
71
echo " Packaging Gameraww..."
63
72
xcrun -sdk iphoneos PackageApplication -v " $WORKSPACE /cmake-build/examples/Gameraww/Release-iphoneos/Gameraww.app" \
64
73
-o " $WORKSPACE /cmake-build/examples/Gameraww/Release-iphoneos/Gameraww.ipa" \
@@ -68,8 +77,8 @@ echo "TNS_IPA_SIZE: "$GAMERAWW_IPA_SIZE"KB"
68
77
echo " TNS_IPA_SIZE_KB\\ n" $GAMERAWW_IPA_SIZE > " $WORKSPACE /build-stats.csv"
69
78
70
79
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
72
81
echo " Packaging TestRunner..."
73
82
xcrun -sdk iphoneos PackageApplication -v " $WORKSPACE /cmake-build/tests/TestRunner/Debug-iphoneos/TestRunner.app" \
74
83
-o " $WORKSPACE /cmake-build/tests/TestRunner/Debug-iphoneos/TestRunner.ipa" \
75
- >> " $WORKSPACE /build.log" 2>&1
84
+ >> " $WORKSPACE /build.log" 2>&1
0 commit comments