forked from stephencelis/SQLite.swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (44 loc) · 1.19 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
BUILD_TOOL = xcodebuild
BUILD_SCHEME = SQLite Mac
BUILD_ARGUMENTS = -scheme "$(BUILD_SCHEME)"
XCPRETTY := $(shell command -v xcpretty)
SWIFTCOV := $(shell command -v swiftcov)
GCOVR := $(shell command -v gcovr)
default: test
build:
$(BUILD_TOOL) $(BUILD_ARGUMENTS)
test:
ifdef XCPRETTY
@set -o pipefail && $(BUILD_TOOL) $(BUILD_ARGUMENTS) test | $(XCPRETTY) -c
else
$(BUILD_TOOL) $(BUILD_ARGUMENTS) test
endif
coverage:
ifdef SWIFTCOV
$(SWIFTCOV) generate --output coverage \
$(BUILD_TOOL) $(BUILD_ARGUMENTS) -configuration Release test \
-- ./SQLite/*.swift
ifdef GCOVR
$(GCOVR) \
--root . \
--use-gcov-files \
--html \
--html-details \
--output coverage/index.html \
--keep
else
@echo gcovr must be installed for HTML output: https://github.com/gcovr/gcovr
endif
else
@echo swiftcov must be installed for coverage: https://github.com/realm/SwiftCov
@exit 1
endif
clean:
$(BUILD_TOOL) $(BUILD_ARGUMENTS) clean
rm -r coverage
repl:
@$(BUILD_TOOL) $(BUILD_ARGUMENTS) -derivedDataPath $(TMPDIR)/SQLite.swift > /dev/null && \
swift -F '$(TMPDIR)/SQLite.swift/Build/Products/Debug'
sloc:
@zsh -c "grep -vE '^ *//|^$$' SQLite/*/*.{swift,h,m} | wc -l"
.PHONY: test coverage clean repl sloc