-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (39 loc) · 1.55 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
project:=Sunday
comma:=,
default: clean build-test-all
check-tools:
@which xcbeautify || (echo "xcbeautify is required. run 'make install-tools'" && exit 1)
install-tools:
brew install xcbeautify
clean:
@rm -rf TestResults
@rm -rf .derived-data
make-test-results-dir:
mkdir -p TestResults
define buildtest
rm -rf ./TestResults/$(1)
set -o pipefail && \
xcodebuild -scheme $(project)-Package \
-derivedDataPath .derived-data/$(1) -resultBundleVersion 3 -resultBundlePath ./TestResults/$(1) -destination '$(2)' \
-enableCodeCoverage=YES -enableAddressSanitizer=YES -enableThreadSanitizer=YES -enableUndefinedBehaviorSanitizer=YES \
-clonedSourcePackagesDirPath ${PWD}/.xcode-pkgs -packageCachePath ${PWD}/.xcode-pkgs/_cache_ \
-skipMacroValidation \
test | xcbeautify
endef
build-test-macos: check-tools
$(call buildtest,macos,platform=macOS)
build-test-ios: check-tools
$(call buildtest,ios,platform=iOS Simulator$(comma)name=iPhone 16)
build-test-tvos: check-tools
$(call buildtest,tvos,platform=tvOS Simulator$(comma)name=Apple TV)
build-test-watchos: check-tools
$(call buildtest,watchos,platform=watchOS Simulator$(comma)name=Apple Watch Series 10 (46mm))
build-test-visionos: check-tools
$(call buildtest,visionos,platform=visionOS Simulator$(comma)name=Apple Vision Pro)
build-test-all: build-test-macos build-test-ios build-test-tvos build-test-watchos
format:
swiftformat --config .swiftformat Sources/ Tests/
lint: make-test-results-dir
swiftlint lint --reporter html > TestResults/lint.html
view_lint: lint
open TestResults/lint.html