Skip to content

Commit de171f4

Browse files
authored
Add a makefile (#28)
I found myself using ZSH history search to remember the specific `docc` commands needed to start a preview server and to build a documentation archive (`.doccarchive` bundle). Another possible approach would be to create a build script, although a build script wouldn't be able to skip rebuilding when source files haven't changed.
2 parents 7d096ac + 5a8889e commit de171f4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This makefile uses only POSIX 'make' features, except for the
2+
# following widely implemented extensions -- the .PHONY target, which
3+
# marks targets that don't generate a file whose name is the same as the
4+
# target, and prerequisites that depend on glob expansion.
5+
6+
.POSIX:
7+
.SUFFIXES:
8+
9+
.DEFAULT: preview
10+
.IGNORE: preview
11+
.PHONY: preview
12+
preview:
13+
swift package --disable-sandbox preview-documentation
14+
15+
.PHONY: archive
16+
archive: .build/plugins/Swift-DocC/outputs/TSPL.doccarchive
17+
18+
.build/plugins/Swift-DocC/outputs/TSPL.doccarchive: Sources/TSPL/TSPL.docc/*/*.md
19+
.build/plugins/Swift-DocC/outputs/TSPL.doccarchive: Sources/TSPL/TSPL.docc/Assets/*.png
20+
swift package generate-documentation

0 commit comments

Comments
 (0)