-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathMakefile
45 lines (34 loc) · 1.16 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
# if provided, FILTER is used as the --filter argument to `swift test`.
ifdef FILTER
FILTERARG = --filter $(FILTER)
else
FILTERARG =
endif
# if no value provided assume sourcery is in the user's PATH
SOURCERY ?= sourcery
define check_for_gem
gem list $(1) -i > /dev/null || gem install $(1) || { echo "ERROR: Failed to locate or install the ruby gem $(1); please install yourself with 'gem install $(1)' (you may need to use sudo)"; exit 1; }
endef
all:
swift build -v
exports:
$(SOURCERY) --sources Sources/MongoSwift/ --templates Sources/MongoSwiftSync/Exports.stencil --output Sources/MongoSwiftSync/Exports.swift
test:
swift test -v $(FILTERARG)
test-pretty:
@$(call check_for_gem,xcpretty)
set -o pipefail && swift test $(FILTERARG) 2>&1 | xcpretty
lint:
swiftlint --fix
swiftlint
lint-and-format:
swiftlint --fix
swiftlint --strict --quiet
swiftformat --lint .
# MacOS only
coverage:
swift test --enable-code-coverage
xcrun llvm-cov export -format="lcov" .build/debug/mongo-swift-driverPackageTests.xctest/Contents/MacOS/mongo-swift-driverPackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov
clean:
rm -rf .build
rm Package.resolved