Keep the catalog authority safeguards while reducing task-runner duplication. GUI run and build commands now validate only the default fixture profile they actually package; the peer-CLI image and matrix retain the aggregate check for default, solid, multi-archive, and unknown-game profiles. Remove publisher-only format, lint, and test wrappers because the workspace recipes already cover the same crate and targets. Test Plan: - `just --fmt --check` -- passed - `just fixture-catalogs-check` -- passed - `just test` -- passed - `just clippy` -- passed - `just frontend-test` -- passed, 91/91 - `just build` -- passed - `git diff --cached --check` -- passed
189 lines
8.4 KiB
Makefile
189 lines
8.4 KiB
Makefile
export RUSTFLAGS := "-C target-cpu=native"
|
|
export WEBKIT_DISABLE_COMPOSITING_MODE := "1"
|
|
export DOCKER_CONFIG := env_var_or_default("DOCKER_CONFIG", ".lanspread-peer-cli/docker-config")
|
|
|
|
default: run
|
|
|
|
FIXTURE_CATALOG_SOURCE := "crates/lanspread-tauri-deno-ts/src-tauri/game.db"
|
|
FIXTURE_CATALOG_ROOT := "crates/lanspread-peer-cli/catalogs"
|
|
FIXTURE_UNRAR := "crates/lanspread-tauri-deno-ts/src-tauri/binaries/unrar-x86_64-unknown-linux-gnu"
|
|
TAURI_DEV_CONFIG := '{"bundle":{"resources":{"../../lanspread-peer-cli/catalogs/default/game.db":"game.db","../../lanspread-peer-cli/catalogs/default/manifests/":"manifests/","assets/*":"assets/"}}}'
|
|
TAURI_FIXTURE_ENV := "LANSPREAD_USE_FIXTURE_CATALOG=1"
|
|
|
|
setup:
|
|
cargo install tauri-cli
|
|
cd crates/lanspread-tauri-deno-ts && deno install --frozen=true
|
|
|
|
run: fixture-catalog-check
|
|
{{ TAURI_FIXTURE_ENV }} cargo tauri dev --config crates/lanspread-tauri-deno-ts/src-tauri/tauri.dev.conf.json --release
|
|
|
|
build: fixture-catalog-check
|
|
{{ TAURI_FIXTURE_ENV }} cargo tauri build --config crates/lanspread-tauri-deno-ts/src-tauri/tauri.dev.conf.json --no-bundle #-- --profile dev
|
|
|
|
bundle: catalog-check-production
|
|
cargo tauri build --config crates/lanspread-tauri-deno-ts/src-tauri/tauri.production.conf.json -- --profile production
|
|
|
|
fmt:
|
|
cargo +nightly fmt
|
|
tombi format
|
|
fd -tf -e md -x prettier --write --prose-wrap always --print-width 80
|
|
rumdl check --flavor commonmark --fix
|
|
just --fmt
|
|
|
|
_fix:
|
|
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo fix --workspace --all-targets --all-features
|
|
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo clippy --workspace --all-targets --all-features --fix
|
|
|
|
fix: _fix fmt
|
|
|
|
clippy:
|
|
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
|
|
test:
|
|
{{ TAURI_FIXTURE_ENV }} TAURI_CONFIG='{{ TAURI_DEV_CONFIG }}' cargo test --workspace --all-targets --all-features
|
|
|
|
# Regenerate the committed acceptance catalogs from their fixture packages.
|
|
fixture-catalogs:
|
|
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
|
|
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
|
|
--output-dir {{ FIXTURE_CATALOG_ROOT }}/default \
|
|
--unrar {{ FIXTURE_UNRAR }} \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-alpha/alienswarm \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-alpha/bf1942 \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-alpha/ggoo \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-bravo/bfbc2 \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-bravo/cnc4 \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-bravo/cnctw \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-charlie/cod5 \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-charlie/cod6 \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-charlie/coh \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-persona/css
|
|
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
|
|
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
|
|
--output-dir {{ FIXTURE_CATALOG_ROOT }}/solid \
|
|
--unrar {{ FIXTURE_UNRAR }} \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-solid/cnctw
|
|
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
|
|
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
|
|
--output-dir {{ FIXTURE_CATALOG_ROOT }}/multi \
|
|
--unrar {{ FIXTURE_UNRAR }} \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-multi/cnctw
|
|
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
|
|
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
|
|
--output-dir {{ FIXTURE_CATALOG_ROOT }}/unknown \
|
|
--unrar {{ FIXTURE_UNRAR }} \
|
|
--game-root crates/lanspread-peer-cli/fixtures/fixture-unknown/cod2
|
|
|
|
fixture-catalog OUTPUT GAME_ROOT:
|
|
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
|
|
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
|
|
--output-dir "{{ OUTPUT }}" \
|
|
--unrar {{ FIXTURE_UNRAR }} \
|
|
--game-root "{{ GAME_ROOT }}"
|
|
|
|
fixture-download-only-catalog OUTPUT GAME_ID GAME_ROOT:
|
|
cargo run -p lanspread-compat --bin lanspread-fixture-catalog -- \
|
|
--source-catalog-db {{ FIXTURE_CATALOG_SOURCE }} \
|
|
--output-dir "{{ OUTPUT }}" \
|
|
--unrar {{ FIXTURE_UNRAR }} \
|
|
--game-root "{{ GAME_ROOT }}" \
|
|
--no-stream-install "{{ GAME_ID }}"
|
|
|
|
fixture-catalog-check:
|
|
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
|
|
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/default/game.db --all
|
|
|
|
# Check every catalog profile used by the peer-CLI acceptance matrix.
|
|
fixture-catalogs-check: fixture-catalog-check
|
|
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
|
|
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/solid/game.db --all
|
|
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
|
|
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/multi/game.db --all
|
|
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
|
|
--catalog-db {{ FIXTURE_CATALOG_ROOT }}/unknown/game.db --all
|
|
|
|
catalog-check-production:
|
|
cargo run -p lanspread-compat --bin lanspread-catalog-publisher -- check \
|
|
--catalog-db crates/lanspread-tauri-deno-ts/src-tauri/game.db --all
|
|
|
|
frontend-test:
|
|
cd crates/lanspread-tauri-deno-ts && deno test --unstable-sloppy-imports tests
|
|
|
|
clean:
|
|
cargo clean
|
|
|
|
peer-cli-build:
|
|
cargo build -p lanspread-peer-cli
|
|
|
|
peer-cli-image: fixture-catalogs-check
|
|
mkdir -p "$DOCKER_CONFIG"
|
|
docker build -f crates/lanspread-peer-cli/Dockerfile -t lanspread-peer-cli:dev .
|
|
|
|
peer-cli-tests *SCENARIOS: peer-cli-image
|
|
python3 crates/lanspread-peer-cli/scripts/run_extended_scenarios.py {{ SCENARIOS }}
|
|
|
|
# macvlan: each peer container gets its own MAC/IP on the real LAN.
|
|
# Override on the command line if your LAN differs, e.g.
|
|
# just LANSPREAD_PARENT_IFACE=enp4s0 LANSPREAD_SUBNET=10.0.0.0/24 LANSPREAD_GATEWAY=10.0.0.1 peer-cli-net
|
|
LANSPREAD_NET := "lanspread"
|
|
LANSPREAD_PARENT_IFACE := "eth0"
|
|
LANSPREAD_SUBNET := "192.168.1.0/24"
|
|
LANSPREAD_GATEWAY := "192.168.1.1"
|
|
|
|
peer-cli-net:
|
|
mkdir -p "$DOCKER_CONFIG"
|
|
docker network inspect {{ LANSPREAD_NET }} >/dev/null 2>&1 || \
|
|
docker network create -d macvlan \
|
|
--subnet={{ LANSPREAD_SUBNET }} \
|
|
--gateway={{ LANSPREAD_GATEWAY }} \
|
|
-o parent={{ LANSPREAD_PARENT_IFACE }} \
|
|
{{ LANSPREAD_NET }}
|
|
|
|
peer-cli-run NAME: peer-cli-net
|
|
mkdir -p ".lanspread-peer-cli/{{ NAME }}/state" ".lanspread-peer-cli/{{ NAME }}/games"
|
|
docker run --rm --init --network {{ LANSPREAD_NET }} --name "lanspread-peer-cli-{{ NAME }}" -i \
|
|
-v "$PWD/.lanspread-peer-cli/{{ NAME }}/state:/state" \
|
|
-v "$PWD/.lanspread-peer-cli/{{ NAME }}/games:/games" \
|
|
lanspread-peer-cli:dev \
|
|
--name "{{ NAME }}" \
|
|
--games-dir /games \
|
|
--state-dir /state \
|
|
--catalog-db /app/game.db \
|
|
--manifests-dir /app/manifests
|
|
|
|
peer-cli-alpha: peer-cli-net
|
|
mkdir -p ".lanspread-peer-cli/alpha/state"
|
|
docker run --rm --init --network lanspread --name "lanspread-peer-cli-alpha" -i \
|
|
-v "$PWD/.lanspread-peer-cli/alpha/state:/state" \
|
|
-v "$PWD/crates/lanspread-peer-cli/fixtures/fixture-alpha:/games:ro" \
|
|
lanspread-peer-cli:dev \
|
|
--name "alpha" \
|
|
--games-dir /games \
|
|
--state-dir /state \
|
|
--catalog-db /app/game.db \
|
|
--manifests-dir /app/manifests
|
|
|
|
peer-cli-bravo: peer-cli-net
|
|
mkdir -p ".lanspread-peer-cli/bravo/state"
|
|
docker run --rm --init --network lanspread --name "lanspread-peer-cli-bravo" -i \
|
|
-v "$PWD/.lanspread-peer-cli/bravo/state:/state" \
|
|
-v "$PWD/crates/lanspread-peer-cli/fixtures/fixture-bravo:/games:ro" \
|
|
lanspread-peer-cli:dev \
|
|
--name "bravo" \
|
|
--games-dir /games \
|
|
--state-dir /state \
|
|
--catalog-db /app/game.db \
|
|
--manifests-dir /app/manifests
|
|
|
|
peer-cli-charlie: peer-cli-net
|
|
mkdir -p ".lanspread-peer-cli/charlie/state"
|
|
docker run --rm --init --network lanspread --name "lanspread-peer-cli-charlie" -i \
|
|
-v "$PWD/.lanspread-peer-cli/charlie/state:/state" \
|
|
-v "$PWD/crates/lanspread-peer-cli/fixtures/fixture-charlie:/games:ro" \
|
|
lanspread-peer-cli:dev \
|
|
--name "charlie" \
|
|
--games-dir /games \
|
|
--state-dir /state \
|
|
--catalog-db /app/game.db \
|
|
--manifests-dir /app/manifests
|