-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
95 lines (79 loc) · 2.64 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
SWIFT_PACKAGE_VERSION := $(shell swift package tools-version)
# Lint fix and format code.
.PHONY: lint-fix
swiftlint:
mint run swiftlint lint --fix --config .swiftlint.yml --format --quiet
swiftformat:
mint run swiftformat . --swiftversion ${SWIFT_PACKAGE_VERSION}
lint-fix: swiftlint swiftformat
# Generate code
.PHONY: generate-code
generate-code:
mint run sourcery --quiet --config ./.sourcery.yml
mint run sourcery --quiet --config ./.sourceryTests.yml
# Run pre-push tasks
.PHONY: pre-push
pre-push: generate-code lint-fix
.PHONY: precommit
precommit: pre-push
.PHONY: setup-brew
setup-brew:
@which -s brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
@brew update
.PHONY: install-dependencies-macOS
install-dependencies-macOS: setup-brew
brew install mint
mint bootstrap
.PHONY: setupEnvironment
setupEnvironment: install-dependencies-macOS
# Build debug version
.PHONY: build-debug
build-debug:
swift build -c debug
# Build release version
.PHONY: build-release
build-release:
swift build -c release --skip-update
# Test links in README
# requires <https://github.com/tcort/markdown-link-check>
.PHONY: testReadme
testReadme:
markdown-link-check -p -v ./README.md
# Delete package build artifacts.
.PHONY: clean
clean: clean-sourcery
swift package clean
# Clean sourcery cache
.PHONY: clean-sourcery
clean-sourcery:
rm -rdf ${HOME}/Library/Caches/Sourcery
# Preview DocC documentation
.PHONY: preview-docs
preview-docs:
swift package --disable-sandbox preview-documentation --target FirebladeECS
# Preview DocC documentation with analysis/warnings and overview of coverage
.PHONY: preview-analysis-docs
preview-analysis-docs:
swift package --disable-sandbox preview-documentation --target FirebladeECS --analyze --experimental-documentation-coverage --level brief
# Generates a plain DocC archive in the .build directory
.PHONY: generate-docs
generate-docs:
DOCC_JSON_PRETTYPRINT=YES \
swift package \
generate-documentation \
--fallback-bundle-identifier com.github.fireblade-engine.FirebladeECS \
--target FirebladeECS \
# Generates documentation pages suitable to push/host on github pages (or another static site)
# Expected location, if set up, would be:
# https://fireblade-engine.github.io/FirebladeECS/documentation/FirebladeECS/
.PHONY: generate-docs-githubpages
generate-docs-githubpages:
DOCC_JSON_PRETTYPRINT=YES \
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--fallback-bundle-identifier com.github.fireblade-engine.FirebladeECS \
--target FirebladeECS \
--output-path ./docs \
--transform-for-static-hosting \
--hosting-base-path 'FirebladeECS'