-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
56 lines (47 loc) · 1.33 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
CONFIG = debug
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iPhone)
PLATFORM_MACOS = macOS
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,TV)
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,Watch)
test-all: test build
test:
xcodebuild test \
-configuration $(CONFIG) \
-scheme Clocks \
-destination platform="$(PLATFORM_IOS)"
build:
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
xcodebuild \
-configuration $(CONFIG) \
-workspace Clocks.xcworkspace \
-scheme Clocks \
-destination platform="$$platform" || exit 1; \
done;
test-linux:
docker run \
--rm \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.8 \
bash -c 'make test-swift'
test-swift:
swift test \
--enable-test-discovery \
--parallel
build-for-library-evolution:
swift build \
-c release \
--target Clocks \
-Xswiftc -emit-module-interface \
-Xswiftc -enable-library-evolution
format:
swift format \
--ignore-unparsable-files \
--in-place \
--recursive \
./Package.swift ./Sources ./Tests
.PHONY: format test
define udid_for
$(shell xcrun simctl list --json devices available $(1) | jq -r '.devices | to_entries | map(select(.value | add)) | sort_by(.key) | last.value | last.udid')
endef