-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
155 lines (121 loc) · 4.78 KB
/
justfile
File metadata and controls
155 lines (121 loc) · 4.78 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# WebFluent — build, package, and release tasks
set dotenv-load := false
version := `grep '^version' Cargo.toml | head -1 | cut -d'"' -f2`
target_linux := "x86_64-unknown-linux-gnu"
target_windows := "x86_64-pc-windows-gnu"
# ── Build ────────────────────────────────────────────
# Build debug binary
build:
cargo build
# Build release binary (compiler + LSP)
release:
cargo build --release
# Build only the LSP server
lsp:
cargo build --release -p wf-lsp
# Install LSP server to ~/.cargo/bin
install-lsp:
cargo install --path crates/wf-lsp
# Build for a specific target
build-target target:
cargo build --release --target {{target}}
# Cross-compile for Windows (requires mingw-w64)
build-windows:
cargo build --release --target {{target_windows}}
# ── Run ──────────────────────────────────────────────
# Run the CLI with arguments
run *args:
cargo run -- {{args}}
# Build and serve the docs site locally
site:
cargo build --release
target/release/wf build -d site
target/release/wf dev -d site
# Build the docs site for production
site-build:
cargo build --release
target/release/wf build -d site
# ── Package ──────────────────────────────────────────
# Build .deb package (installs cargo-deb if needed)
deb:
@which cargo-deb > /dev/null 2>&1 || cargo install cargo-deb
cargo deb
# Build .deb without rebuilding (uses existing release binary)
deb-fast:
@which cargo-deb > /dev/null 2>&1 || cargo install cargo-deb
cargo deb --no-build
# Build Windows .msi installer (requires wix on Windows or cross-build)
msi:
@echo "Building Windows installer..."
just build-windows
just _package-msi
# Build both .deb and tarball
package-linux: release
just deb-fast
just tarball-linux
# Build ALL packages (Linux .deb + tarball, Windows .zip, docs site)
package-all: release
@echo "══════════════════════════════════════════"
@echo " Packaging WebFluent v{{version}}"
@echo "══════════════════════════════════════════"
mkdir -p dist
@echo "\n── Linux .deb ──"
just deb-fast
cp target/debian/*.deb dist/ 2>/dev/null || true
@echo "\n── Linux tarball ──"
just tarball-linux
@echo "\n── Windows .exe ──"
just build-windows
just zip-windows
@echo "\n── Docs site ──"
just site-build
@echo "\n══════════════════════════════════════════"
@echo " Done! Artifacts in dist/"
@echo "══════════════════════════════════════════"
@ls -lh dist/
# Create Linux tarball
tarball-linux:
mkdir -p dist
tar czf dist/wf-{{version}}-{{target_linux}}.tar.gz -C target/release wf
# Create Windows zip (after cross-compiling)
zip-windows:
mkdir -p dist
zip -j dist/wf-{{version}}-{{target_windows}}.zip target/{{target_windows}}/release/wf.exe
# ── Test ─────────────────────────────────────────────
# Run all tests
test:
cargo test
# Run clippy lints
lint:
cargo clippy -- -W clippy::all
# Format code
fmt:
cargo fmt
# Check formatting without modifying
fmt-check:
cargo fmt -- --check
# ── Clean ────────────────────────────────────────────
# Clean build artifacts
clean:
cargo clean
rm -rf dist/
# ── Release ──────────────────────────────────────────
# Tag and push a release (usage: just tag v0.1.0)
tag version:
git tag {{version}}
git push origin {{version}}
# Show current version
version:
@echo {{version}}
# ── Helpers ──────────────────────────────────────────
# Install dev dependencies
setup:
cargo install cargo-deb
rustup target add {{target_windows}}
@echo "Install mingw-w64 for Windows cross-compilation:"
@echo " sudo apt install gcc-mingw-w64-x86-64"
# List available recipes
[private]
_package-msi:
@echo "MSI packaging requires Windows. Use the GitHub Actions release workflow."
@echo "Or install 'cargo-wix' and run: cargo wix"