forked from chojnac/Dumpling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (56 loc) · 1.68 KB
/
Makefile
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
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
IOS_SIMULATOR = "iOS Simulator,name=iPhone 12 Pro,OS=14.4"
DERIVED_DATA_DIR=$(ROOT_DIR)/.build/DerivedData
.PHONY: pre_checks_macos default
default:
pre_checks_macos:
# ifeq (, $(shell which xcpretty))
# $(error "No xcpretty in PATH, consider doing gem install xcpretty")
# endif
build:
swift build
test:
swift test
(cd IntegrationTests && swift test)
test-swift:
swift test --enable-test-discovery
test-ios: pre_checks_macos
set -o pipefail && \
xcodebuild test \
-derivedDataPath $(DERIVED_DATA_DIR) \
-scheme Dumpling \
-destination platform=$(IOS_SIMULATOR) | xcpretty
test-macos: pre_checks_macos
set -o pipefail && \
xcodebuild test \
-derivedDataPath $(DERIVED_DATA_DIR) \
-scheme Dumpling \
-destination platform="macOS" | xcpretty
test-integration-swift:
cd IntegrationTests && swift test --enable-test-discovery
test-integration-ios: pre_checks_macos
cd IntegrationTests && \
set -o pipefail && \
xcodebuild test \
-derivedDataPath $(DERIVED_DATA_DIR) \
-scheme "DumplingIntegrationTests-Package" \
-destination platform=$(IOS_SIMULATOR) | xcpretty
test-integration-macos: pre_checks_macos
cd IntegrationTests && \
set -o pipefail && \
xcodebuild test \
-derivedDataPath $(DERIVED_DATA_DIR) \
-scheme "DumplingIntegrationTests-Package" \
-destination platform="macos" | xcpretty
test-linux:
docker run \
--rm \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.3 \
bash -c 'make test-swift test-integration-swift'
test-all: test-macos test-ios
test-integration-all: test-integration-ios test-integration-macos
clean:
swift package clean
(cd ItegrationTests && swift package clean)