-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
30 lines (25 loc) · 965 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
SWIFT_FORMAT_BIN := swift format
GIT_REPO_TOPLEVEL := $(shell git rev-parse --show-toplevel)
SWIFT_FORMAT_CONFIG_FILE := $(GIT_REPO_TOPLEVEL)/.swift-format.json
format:
$(SWIFT_FORMAT_BIN) \
--configuration $(SWIFT_FORMAT_CONFIG_FILE) \
--ignore-unparsable-files \
--in-place \
--recursive \
$(GIT_REPO_TOPLEVEL)/Package.swift $(GIT_REPO_TOPLEVEL)/Sources $(GIT_REPO_TOPLEVEL)/Tests
lint:
$(SWIFT_FORMAT_BIN) lint \
--configuration $(SWIFT_FORMAT_CONFIG_FILE) \
--ignore-unparsable-files \
--recursive \
$(GIT_REPO_TOPLEVEL)/Package.swift $(GIT_REPO_TOPLEVEL)/Sources $(GIT_REPO_TOPLEVEL)/Tests
test:
swift test --parallel --enable-code-coverage
coverage: test
xcrun llvm-cov export \
-format=lcov \
-instr-profile=.build/arm64-apple-macosx/debug/codecov/default.profdata \
.build/arm64-apple-macosx/debug/WaniKaniPackageTests.xctest/Contents/MacOS/WaniKaniPackageTests \
> lcov.info
.PHONY: format lint test coverage