forked from stephencelis/SQLite.swift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (32 loc) · 1008 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
31
32
33
34
35
36
37
38
39
40
41
BUILD_TOOL = xcodebuild
BUILD_SCHEME = SQLite Mac
IOS_SIMULATOR = iPhone 12
IOS_VERSION = 15.0
ifeq ($(BUILD_SCHEME),SQLite iOS)
BUILD_ARGUMENTS = -scheme "$(BUILD_SCHEME)" -destination "platform=iOS Simulator,name=$(IOS_SIMULATOR),OS=$(IOS_VERSION)"
else
BUILD_ARGUMENTS = -scheme "$(BUILD_SCHEME)"
endif
XCPRETTY := $(shell command -v xcpretty)
TEST_ACTIONS := clean build build-for-testing test-without-building
default: test
build:
$(BUILD_TOOL) $(BUILD_ARGUMENTS)
lint:
swiftlint --strict
lint-fix:
swiftlint lint fix
test:
ifdef XCPRETTY
@set -o pipefail && $(BUILD_TOOL) $(BUILD_ARGUMENTS) $(TEST_ACTIONS) | $(XCPRETTY) -c
else
$(BUILD_TOOL) $(BUILD_ARGUMENTS) $(TEST_ACTIONS)
endif
clean:
$(BUILD_TOOL) $(BUILD_ARGUMENTS) clean
repl:
@$(BUILD_TOOL) $(BUILD_ARGUMENTS) -derivedDataPath $(TMPDIR)/SQLite.swift > /dev/null && \
swift -F '$(TMPDIR)/SQLite.swift/Build/Products/Debug'
sloc:
@zsh -c "grep -vE '^ *//|^$$' Sources/**/*.{swift,h,m} | wc -l"
.PHONY: test clean repl sloc