# Justfile — project-wide build and dev commands # Install with: cargo install just # Usage: just # Default: list all recipes default: @just --list # ── Setup ────────────────────────────────────────────────────────────────────── # Install all required tools setup: @echo "Installing build tools..." cargo install trunk # WASM bundler cargo install wasm-bindgen-cli rustup target add wasm32-unknown-unknown @echo "All tools installed!" # ── Native builds ────────────────────────────────────────────────────────────── # Run the asset viewer (native, debug) run: cargo run --bin sylpheed-viewer # Run with hot-reloading enabled (faster iteration) run-dev: cargo run --bin sylpheed-viewer --features sylpheed-viewer/dev # Build native release build-native: cargo build --release --bin sylpheed-viewer # Run the CLI cli *ARGS: cargo run --bin sylpheed-cli -- {{ARGS}} # ── WASM / Web builds ────────────────────────────────────────────────────────── # Start WASM dev server with hot-reload web: trunk serve # Build WASM release bundle (output in ./dist/) build-web: trunk build --release # ── Extraction shortcuts ─────────────────────────────────────────────────────── # Extract an ISO to ./assets/ (required before running the viewer) # Usage: just extract path/to/game.iso extract ISO: cargo run --bin sylpheed-cli -- extract {{ISO}} ./assets/ @echo "Extraction complete. Run: just run" # List files in an ISO # Usage: just list path/to/game.iso list ISO: cargo run --bin sylpheed-cli -- list {{ISO}} # Sniff file formats in ./assets/ sniff: cargo run --bin sylpheed-cli -- sniff ./assets/ # Sniff but only show unknown formats (focus RE effort) sniff-unknown: cargo run --bin sylpheed-cli -- sniff ./assets/ --unknown-only # ── Testing ──────────────────────────────────────────────────────────────────── # Run all tests test: cargo test --workspace # Run the disc-backed suites. They are gated on the environment ALONE now (#16): # no source file hardcodes a path any more, so nothing runs by accident because # a machine happens to have a directory. Put your paths in `.env` (already # gitignored as a local dev override): # # SYLPHEED_DISC="/path/to/extracted/disc" # the dir containing dat/ # # QUOTE the values. These paths contain spaces, and an unquoted `VAR=a b c` # is parsed as "run command b with VAR=a" -- it fails silently into ABSENT. # SYLPHEED_RES3D=/path/to/hidden/resource3d # SYLPHEED_ISO=/path/to/game.iso # # Read the corpus block the run prints -- the pass/fail tally is identical # whether or not the corpus was exercised, which is the whole of #16. test-disc: #!/usr/bin/env bash set -euo pipefail [ -f .env ] && set -a && . ./.env && set +a cargo test --workspace echo "--- corpus report ---" cat target/sylpheed-corpus-report.txt # Run tests including ISO integration tests (requires SYLPHEED_ISO env var) test-integration: SYLPHEED_ISO=./game.iso cargo test --workspace -- --include-ignored # ── Code quality ────────────────────────────────────────────────────────────── # Format all code fmt: cargo fmt --all # Lint lint: cargo clippy --workspace -- -D warnings # Check everything compiles (faster than full build) check: cargo check --workspace cargo check --workspace --target wasm32-unknown-unknown # ── All platforms CI check ──────────────────────────────────────────────────── # Full CI: format check + lint + test + WASM compile check ci: cargo fmt --all -- --check cargo clippy --workspace -- -D warnings cargo test --workspace cargo check --target wasm32-unknown-unknown -p sylpheed-viewer @echo "All CI checks passed!"