mirror of
https://github.com/Xevion/Pac-Man.git
synced 2026-01-30 22:24:58 -06:00
61 lines
1.7 KiB
Makefile
61 lines
1.7 KiB
Makefile
set shell := ["bash", "-c"]
|
|
|
|
binary_extension := if os() == "windows" { ".exe" } else { "" }
|
|
|
|
# Run cargo-vcpkg build for SDL2 dependencies
|
|
vcpkg:
|
|
cargo vcpkg build
|
|
|
|
# Run the game, pass args (e.g., `just pacman::run -r` for release)
|
|
run *args:
|
|
cargo run -p pacman {{args}}
|
|
|
|
# Run all checks (clippy for desktop + wasm, warns on format) for pacman package
|
|
check:
|
|
@echo "Checking format..."
|
|
@cargo fmt -p pacman -- --check || echo "⚠ Format issues detected (run \`just format\` to fix)"
|
|
@echo "Running clippy for desktop target..."
|
|
@cargo clippy -p pacman --all-targets --all-features --quiet -- -D warnings
|
|
@echo "Running clippy for wasm target..."
|
|
@cargo clippy -p pacman --target wasm32-unknown-emscripten --all-targets --all-features --quiet -- -D warnings
|
|
@echo "All checks passed!"
|
|
|
|
# Run tests with nextest for pacman package
|
|
test:
|
|
cargo nextest run -p pacman --no-fail-fast
|
|
|
|
# Auto-format code for pacman package
|
|
format:
|
|
cargo fmt -p pacman
|
|
|
|
# Fix linting errors & formatting
|
|
fix:
|
|
cargo fix --workspace --lib --allow-dirty
|
|
cargo fmt --all
|
|
|
|
# Profile using samply
|
|
samply:
|
|
cargo build --profile profile
|
|
samply record ./target/profile/pacman{{binary_extension}}
|
|
|
|
# Generate baseline LCOV report
|
|
coverage:
|
|
cargo +nightly llvm-cov \
|
|
--lcov \
|
|
--remap-path-prefix \
|
|
--workspace \
|
|
--output-path lcov.info \
|
|
--profile coverage \
|
|
--no-fail-fast nextest
|
|
|
|
# Display coverage report
|
|
report-coverage: coverage
|
|
cargo llvm-cov report --remap-path-prefix
|
|
|
|
# Open HTML coverage report
|
|
html: coverage
|
|
cargo llvm-cov report \
|
|
--remap-path-prefix \
|
|
--html \
|
|
--open
|