#!/usr/bin/env bash # Compile the benchmark harness: the density benchmark and the isolation check. # # MM_HOME extracted MegaMek release # JAVA_HOME a JDK # # Compiled against the stock MegaMek jar using only public API, the same # constraint src/ lives under. A clean compile here is evidence the embedding # approach still holds after a MegaMek bump. set -euo pipefail HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" : "${MM_HOME:?MM_HOME is required}" : "${JAVA_HOME:?JAVA_HOME is required}" CP="$MM_HOME/MegaMek.jar" for jar in "$MM_HOME"/lib/*.jar; do CP="$CP:$jar"; done OUT="${OUT:-/tmp/bench-classes}" rm -rf "$OUT" mkdir -p "$OUT" "$JAVA_HOME/bin/javac" -nowarn -Xlint:-options -classpath "$CP" -d "$OUT" "$HERE"/src/bench/*.java echo "built -> $OUT"