-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (52 loc) · 1.55 KB
/
Makefile
File metadata and controls
73 lines (52 loc) · 1.55 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
TARGET = SQLyra
SNIPPETS := $(notdir $(basename $(wildcard Snippets/*.swift)))
.PHONY: clean lint format test-linux $(SNIPPETS) test-snippets learn preview-doc
clean:
swift package clean
rm -rf ./build
rm -rf ./Snippets/db.sqlite
README.md: Playgrounds/README.playground/Contents.swift
cat $< | ./Scripts/markdown.swift > $@
# MARK: - format
lint:
xcrun swift-format lint --recursive --strict ./
format:
xcrun swift-format --recursive --in-place ./
# MARK: - Apple Tests
XCODEBUILD_TEST = xcodebuild test \
-quiet \
-scheme $(TARGET) \
-resultBundlePath $@
XCCOV = xcrun xccov view --files-for-target $(TARGET) --report $@
build/test-macos.xcresult:
$(XCODEBUILD_TEST) -destination 'platform=macOS'
$(XCCOV)
build/test-ios.xcresult:
$(XCODEBUILD_TEST) -destination 'platform=iOS Simulator,name=iPhone 17'
$(XCCOV)
# MARK: - Linux Tests
# Apple Container or Docker
CONTAINER ?= container
test-linux:
$(CONTAINER) run --rm -v "$(PWD):/src" -w /src swift:latest /bin/bash -c \
"apt-get update && apt-get install -y libsqlite3-dev && swift test"
# MARK: - Snippets
$(SNIPPETS):
swift run --quiet $@
run-snippets: $(SNIPPETS)
learn:
SWIFTPM_ENABLE_SNIPPETS=1 swift package learn
# MARK: - DocC
build/docs:
mkdir -p $@
env SQLYRA_DOCС_PLUGIN=1 \
swift package --allow-writing-to-directory $@ \
generate-documentation \
--target $(TARGET) \
--transform-for-static-hosting \
--hosting-base-path $(TARGET) \
--output-path $@
preview-doc:
env SQLYRA_DOCС_PLUGIN=1 \
swift package --disable-sandbox \
preview-documentation --target $(TARGET)