-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
201 lines (155 loc) · 5.71 KB
/
Copy pathjustfile
File metadata and controls
201 lines (155 loc) · 5.71 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# FlatCityBuf Workspace Justfile
#
# Unified task runner for entire FlatCityBuf workspace (Rust, C++, Python, WASM)
# Default recipe - list all available commands
default:
@just --list
# ============================================================================
# Workspace Commands
# ============================================================================
# Run all pre-commit checks (Rust format, clippy, WASM, Python)
pre-commit: check-common check-wasm check-py pre-commit-cpp
# Common workspace checks (Rust workspace format, clippy, test, build)
check-common:
cd src/rust && cargo fmt
cd src/rust && cargo clippy --fix --allow-dirty --workspace --all-targets --all-features --exclude fcb_wasm --exclude fcb_py
cd src/rust && cargo clippy --fix --allow-dirty -p fcb_wasm --target wasm32-unknown-unknown
cd src/rust && cargo nextest run --all-features --workspace --exclude fcb_wasm --exclude fcb_py
cd src/rust && cargo check --all-features --workspace --exclude fcb_wasm --exclude fcb_py
cd src/rust && cargo build --workspace --all-features --exclude fcb_wasm --exclude fcb_py
# Run WASM-specific checks
check-wasm:
cd src/rust && cargo clippy --fix --allow-dirty -p fcb_wasm --target wasm32-unknown-unknown
cd src/rust && cargo check -p fcb_wasm --target wasm32-unknown-unknown
cd src/rust && cargo build -p fcb_wasm --target wasm32-unknown-unknown
# Run Python-specific checks
check-py:
cd src/rust/fcb_py && uv sync --extra dev
cd src/rust/fcb_py && uv run maturin develop
cd src/rust/fcb_py && uv run ruff check --fix .
cd src/rust/fcb_py && uv run ruff format .
cd src/rust/fcb_py && uv run pytest tests/
# Run C++ binding checks
pre-commit-cpp:
cd src/cpp && cmake -B build -S . && cmake --build build
# Run all generation scripts in scripts directory
gen-all:
@echo "Running all shell scripts in scripts..."
@for script in scripts/*.sh; do \
echo "Executing $script..."; \
bash "$script"; \
done
@echo "All scripts executed."
# Build entire workspace (Rust + C++ + Python)
build-all: gen-all build build-cpp build-py
# ============================================================================
# Rust Commands
# ============================================================================
# Build Rust workspace
build:
cd src/rust && cargo build
# Build Rust workspace with release optimizations
build-release:
cd src/rust && cargo build --release
# Clean Rust build artifacts
clean:
cd src/rust && cargo clean
# Run tests
test:
cd src/rust && cargo test
# Run tests with output
test-verbose:
cd src/rust && cargo test -- --nocapture
# Run clippy linter
clippy:
cd src/rust && cargo clippy -- -D warnings
# Format code
fmt:
cd src/rust && cargo fmt
# Check formatting without making changes
fmt-check:
cd src/rust && cargo fmt --check
# Full CI check (format, clippy, test)
ci: fmt-check clippy test
# Update dependencies
update:
cd src/rust && cargo update
# Check for security vulnerabilities
audit:
cd src/rust && cargo audit
# Generate documentation
docs:
cd src/rust && cargo doc --no-deps --open
# Install development tools
install-tools:
cd src/rust && cargo install just cargo-watch wasm-pack cargo-audit
# Start dev container
devcon:
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash
# Rebuild dev container from scratch
devcon-build:
devcontainer build --workspace-folder . --no-cache
just devcon
# ============================================================================
# C++ Commands
# ============================================================================
# Build C++ bindings
build-cpp:
cd src/cpp && cmake -B build -S . && cmake --build build
# Clean and rebuild C++ bindings
clean-cpp:
cd src/cpp && rm -rf build
# Run C++ roundtrip tests
test-cpp:
cd src/cpp/build && ./fcb_roundtrip_comprehensive ../../rust/fcb_core/tests/data
# ============================================================================
# Python Commands
# ============================================================================
# Sync Python dependencies
py-sync:
cd src/rust/fcb_py && uv sync --extra dev
# Run Python development
py-dev:
cd src/rust/fcb_py && uv run maturin develop
# Run Python linter
py-lint:
cd src/rust/fcb_py && uv run ruff check --fix .
# Format Python code
py-fmt:
cd src/rust/fcb_py && uv run ruff format .
# Run Python tests
py-test:
cd src/rust/fcb_py && uv run pytest tests/
# Clean Python build artifacts
py-clean:
cd src/rust/fcb_py && cargo clean
# Install Python package in development mode
py-develop:
cd src/rust/fcb_py && maturin develop
build-py:
cd src/rust/fcb_py && maturin build --release
# ============================================================================
# WASM Commands
# ============================================================================
# Build WASM package (web target, debug)
build-wasm:
cd src/rust/wasm && wasm-pack build --dev
# Build WASM for production
build-wasm-release:
cd src/rust/wasm && wasm-pack build --release
# ============================================================================
# CLI Commands
# ============================================================================
# Run FCB info command on test data
fcb_info:
cd src/rust && cargo run -p fcb_cli info -i fcb_core/tests/data/delft.fcb
# Generate file statistics (CSV output)
file-stats:
cd src/rust && cargo run -p fcb_core --bin stats -- -d fcb_core/benchmark_data/ -f csv
# Run benchmarks
bench:
cd src/rust && cargo bench -p fcb_core --bench read -- --release
# Build fcb_core release binary
build-fcb_core:
cd src/rust && cargo build --release -p fcb_core