Something went wrong. Try again.
Initial spike on the project (via Claude)
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465#!/usr/bin/env bash# Take a fresh checkout to the point where you can play a match.## ./scripts/bootstrap.sh# ./spike-webswing/start.sh # then open http://localhost:8080/megamek/## Steps, all idempotent:# 1. fetch third-party deps (JDK, MegaMek release + source, Webswing Lite)# 2. compile the harness against the stock MegaMek jar# 3. build MegaMek-patched.jar by applying patches/patchset/# 4. generate the legacy fontconfig Webswing Lite's toolkit requires# 5. prime MegaMek's units.cache so the first launch is not 17s slowerset -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"cd "$ROOT"
step() { printf '\n=== %s ===\n' "$1"; }
step "1/5 third-party dependencies"./scripts/fetch-deps.sh
step "2/5 harness"./harness/build.sh
step "3/5 patched MegaMek jar"./patches/build-patched-jar.sh
step "4/5 fontconfig"# Needs fontconfig tooling on the host; MegaMek's symbol glyphs depend on it.if command -v fc-match >/dev/null; then ./scripts/gen-fontconfig.shelse echo "SKIPPED: fc-match not found. Install fontconfig, then run" >&2 echo " ./scripts/gen-fontconfig.sh" >&2 echo "Without it the MegaMek client dies at startup with 'Fontconfig head is null'." >&2fi
step "5/5 prime units.cache"# MegaMek builds this by walking ~11k unit files on first run - 20s instead of 3s.# Doing it here keeps it out of the first match.MM="$ROOT/MegaMek-0.51.00"if [ -f "$MM/data/mekfiles/units.cache" ]; then echo " already present"else echo " building (this takes ~20s) ..." ( cd "$MM" && "$ROOT/jdk-21.0.12+8/bin/java" \ -Dlog4j2.configurationFile="$ROOT/harness/log4j2-quiet.xml" \ --add-opens java.base/java.util=ALL-UNNAMED \ --add-opens java.base/java.util.concurrent=ALL-UNNAMED \ -cp "$ROOT/harness/out:$ROOT/MegaMek-patched.jar:$(ls "$MM"/lib/*.jar | tr '\n' ':')" \ bench.IsolationCheck >/dev/null 2>&1 ) || true [ -f "$MM/data/mekfiles/units.cache" ] && echo " built" || echo " (not built; first launch will be slower)"fi
cat <<'DONE'
=== ready ===
./spike-webswing/start.sh then open http://localhost:8080/megamek/ ./spike-webswing/stop.sh stop it (never pkill - see README)
You play TraineeA, Princess plays TraineeB. Press "Done" in the lobby.DONE