forked from uber/ios-snapshot-test-case
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·67 lines (61 loc) · 2.4 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
#!/bin/sh
set -eu
function ci_lib() {
NAME=$1
xcodebuild -project FBSnapshotTestCase.xcodeproj \
-scheme "FBSnapshotTestCase iOS" \
-destination "platform=iOS Simulator,name=${NAME}" \
-sdk iphonesimulator \
build-for-testing
xcodebuild -project FBSnapshotTestCase.xcodeproj \
-scheme "FBSnapshotTestCase iOS" \
-destination "platform=iOS Simulator,name=${NAME}" \
-sdk iphonesimulator \
test-without-building
}
function ci_demo() {
NAME=$1
pushd FBSnapshotTestCaseDemo
pod install
xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \
-scheme FBSnapshotTestCaseDemo \
-destination "platform=iOS Simulator,name=${NAME}" \
build-for-testing
xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \
-scheme FBSnapshotTestCaseDemo \
-destination "platform=iOS Simulator,name=${NAME}" \
test-without-building
popd
}
function ci_demo_preprocessor() {
NAME=$1
pushd FBSnapshotTestCaseDemo
pod install
xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \
-scheme FBSnapshotTestCasePreprocessorDemo \
-destination "platform=iOS Simulator,name=${NAME}" \
build-for-testing
xcodebuild -workspace FBSnapshotTestCaseDemo.xcworkspace \
-scheme FBSnapshotTestCasePreprocessorDemo \
-destination "platform=iOS Simulator,name=${NAME}" \
test-without-building
popd
}
function ci_carthage_demo() {
NAME=$1
pushd iOSSnapshotTestCaseCarthageDemo
carthage bootstrap
xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \
-scheme iOSSnapshotTestCaseCarthageDemo \
-destination "platform=iOS Simulator,name=${NAME}" \
build-for-testing
xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \
-scheme iOSSnapshotTestCaseCarthageDemo \
-destination "platform=iOS Simulator,name=${NAME}" \
test-without-building
popd
}
ci_lib "iPhone 8" && ci_demo "iPhone 8" && ci_demo_preprocessor "iPhone 8"
ci_lib "iPhone 11" && ci_demo "iPhone 11" && ci_demo_preprocessor "iPhone 11"
ci_lib "iPhone 8" && ci_carthage_demo "iPhone 8"
ci_lib "iPhone 11" && ci_carthage_demo "iPhone 11"