-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
55 lines (47 loc) · 1.63 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
TOOL = swift run -c release --package-path Tools
PACKAGE = swift package --package-path Tools
SWIFT_FILE_PATHS = Package.swift Sources Tests Examples
TEST_PLATFORM_IOS = iOS Simulator,name=iPhone 13 Pro
TEST_PLATFORM_MACOS = macOS
TEST_PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p) (2nd generation)
TEST_PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 7 - 45mm
.PHONY: proj
proj:
$(TOOL) xcodegen -s Examples/project.yml
.PHONY: format
format:
$(TOOL) swift-format format -i -p -r $(SWIFT_FILE_PATHS)
.PHONY: lint
lint:
$(TOOL) swift-format lint -s -p -r $(SWIFT_FILE_PATHS)
.PHONY: docs
docs:
$(PACKAGE) \
--allow-writing-to-directory docs \
generate-documentation \
--product Hooks \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path swiftui-hooks \
--output-path docs
.PHONY: docs-preview
docs-preview:
$(PACKAGE) \
--disable-sandbox \
preview-documentation \
--product Hooks
.PHONY: test
test: test-library build-examples
.PHONY: test-library
test-library:
for platform in "$(TEST_PLATFORM_IOS)" "$(TEST_PLATFORM_MACOS)" "$(TEST_PLATFORM_TVOS)" "$(TEST_PLATFORM_WATCHOS)"; do \
xcodebuild test -scheme swiftui-hooks -destination platform="$$platform"; \
done
cd Examples \
&& xcodebuild test -scheme Todo-UITests -destination platform="$(TEST_PLATFORM_IOS)" \
&& xcodebuild test -scheme TheMovieDB-MVVM-Tests -destination platform="$(TEST_PLATFORM_IOS)"
.PHONY: build-examples
build-examples:
cd Examples && for scheme in "TheMovieDB-MVVM" "BasicUsage" "Todo" ; do \
xcodebuild build -scheme "$$scheme" -destination platform="$(TEST_PLATFORM_IOS)"; \
done