-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile
48 lines (37 loc) · 969 Bytes
/
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
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
IOS_SIMULATOR = "iOS Simulator,name=iPhone 14 Pro,OS=16.2"
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
test-swift:
swift test -c release
test-ios: pre_checks_macos
set -o pipefail && \
xcodebuild test \
-derivedDataPath $(DERIVED_DATA_DIR) \
-scheme NotionSwift \
-destination platform=$(IOS_SIMULATOR)
test-macos: pre_checks_macos
set -o pipefail && \
xcodebuild test \
-derivedDataPath $(DERIVED_DATA_DIR) \
-scheme NotionSwift \
-destination platform="macOS" | xcpretty
test-linux:
docker run \
--rm \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.9 \
bash -c 'swift test -c release'
test-all: test-macos test-ios
clean:
swift package clean