-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
40 lines (32 loc) · 1.26 KB
/
justfile
File metadata and controls
40 lines (32 loc) · 1.26 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
# Path to the Saga library (local path dependency or SPM checkout)
saga_path := if path_exists("../Saga/Sources/Saga") == "true" { "../Saga" } else { ".build/checkouts/Saga" }
# Development: watch and rebuild on changes
run: clean resolve copy-docs symbol-graph
saga dev
# Resolve SPM dependencies
resolve:
swift package resolve
# Compile without running
compile:
swift build --product Website -j 2
# Full build
build: copy-docs symbol-graph
swift run
# Copy DocC guide markdown files into content/docs/
copy-docs:
rm -rf content/docs
mkdir -p content/docs
cp -r {{saga_path}}/Sources/Saga/Saga.docc/* content/docs/
mv content/docs/Saga.md content/docs/index.md
[ -d content/docs/Guides ] && mv content/docs/Guides content/docs/guides || true
# Generate symbol graph from the Saga library
symbol-graph:
swift package --package-path {{saga_path}} dump-symbol-graph --emit-extension-block-symbols 2>/dev/null || true
mkdir -p .build/symbolgraph
cp {{saga_path}}/.build/*/symbolgraph/Saga.symbols.json .build/symbolgraph/
cp {{saga_path}}/.build/*/symbolgraph/Saga@*.symbols.json .build/symbolgraph/ 2>/dev/null || true
# Clean build artifacts
clean:
rm -rf deploy .build/symbolgraph .build/checkouts/Saga content/docs
format:
swiftformat -swift-version 6 .