This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 267
/
build.sh
executable file
·115 lines (105 loc) · 3.93 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/sh
# Builds all targets and runs tests.
# Defined default derived data location
DERIVED_DATA=${1:-/tmp/LayoutKit}
echo "Derived data location: $DERIVED_DATA";
set -o pipefail &&
echo "Run tests on iOS..." &&
rm -rf $DERIVED_DATA &&
time xcodebuild clean test \
-project LayoutKit.xcodeproj \
-scheme LayoutKit-iOS \
-sdk iphonesimulator12.2 \
-derivedDataPath $DERIVED_DATA \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=12.2' \
-destination 'platform=iOS Simulator,name=iPhone 6 Plus,OS=12.2' \
-destination 'platform=iOS Simulator,name=iPhone 7,OS=12.2' \
-destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=12.2' \
-disable-concurrent-destination-testing test-without-building \
OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' \
| tee build.log \
| xcpretty &&
cat build.log | sh debug-time-function-bodies.sh &&
echo "Run tests on macOS..." &&
time xcodebuild clean test \
-project LayoutKit.xcodeproj \
-scheme LayoutKit-macOS \
-sdk macosx10.14 \
-derivedDataPath $DERIVED_DATA \
OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' \
| tee build.log \
| xcpretty &&
cat build.log | sh debug-time-function-bodies.sh &&
echo "Run tests on tvOS..." &&
rm -rf $DERIVED_DATA &&
time xcodebuild clean test \
-project LayoutKit.xcodeproj \
-scheme LayoutKit-tvOS \
-sdk appletvsimulator12.2 \
-derivedDataPath $DERIVED_DATA \
-destination 'platform=tvOS Simulator,name=Apple TV 4K (at 1080p),OS=12.2' \
OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' \
| tee build.log \
| xcpretty &&
cat build.log | sh debug-time-function-bodies.sh &&
echo "Building sample app..." &&
rm -rf $DERIVED_DATA &&
time xcodebuild clean build \
-project LayoutKit.xcodeproj \
-scheme LayoutKitSampleApp \
-sdk iphonesimulator12.2 \
-derivedDataPath $DERIVED_DATA \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=12.2' \
-destination 'platform=iOS Simulator,name=iPhone 6 Plus,OS=12.2' \
-destination 'platform=iOS Simulator,name=iPhone 7,OS=12.2' \
-destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=12.2' \
-disable-concurrent-destination-testing \
OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' \
| tee ../build.log \
| xcpretty &&
cat build.log | sh debug-time-function-bodies.sh &&
# Test Cocopods, Carthage, Swift Package Management
echo "Building an iOS empty project with cocoapods..." &&
rm -rf $DERIVED_DATA &&
cd Tests/cocoapods/ios &&
pod install &&
time xcodebuild clean build \
-workspace LayoutKit-iOS.xcworkspace \
-scheme LayoutKit-iOS \
-sdk iphonesimulator12.2 \
-derivedDataPath $DERIVED_DATA \
-destination 'platform=iOS Simulator,name=iPhone 7,OS=12.2' \
OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' \
| tee ../../../build.log \
| xcpretty &&
cd ../../.. &&
cat build.log | sh debug-time-function-bodies.sh &&
echo "Building a macOS empty project with cocoapods..." &&
rm -rf $DERIVED_DATA &&
cd Tests/cocoapods/macos &&
pod install &&
time xcodebuild clean build \
-workspace LayoutKit-macOS.xcworkspace \
-scheme LayoutKit-macOS \
-sdk macosx10.14 \
-derivedDataPath $DERIVED_DATA \
OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' \
| tee ../../../build.log \
| xcpretty &&
cd ../../.. &&
cat build.log | sh debug-time-function-bodies.sh &&
echo "Building a tvOS empty project with cocoapods..." &&
rm -rf $DERIVED_DATA &&
cd Tests/cocoapods/tvos &&
pod install &&
time xcodebuild clean build \
-workspace LayoutKit-tvOS.xcworkspace \
-scheme LayoutKit-tvOS \
-sdk appletvsimulator12.2 \
-derivedDataPath $DERIVED_DATA \
-destination 'platform=tvOS Simulator,name=Apple TV 4k (at 1080p),OS=12.2' \
OTHER_SWIFT_FLAGS='-Xfrontend -debug-time-function-bodies' \
| tee ../../../build.log \
| xcpretty &&
cd ../../.. &&
cat build.log | sh debug-time-function-bodies.sh