Files
java-interview-lab/dynamic-programming/scripts/run-all.sh
T

12 lines
602 B
Bash
Executable File

#!/usr/bin/env bash
# Regenerates every file in output/. Needs JDK 25 and Maven. The first Maven run must be online.
# 01-11 are written by JUnit tests that assert the same numbers they print (deterministic).
# 12 runs SpaceDemo under a 48 MB heap: the outcome is deterministic, the "max heap" line is whatever the JVM reports.
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p output
mvn -B -q -T1 test
mvn -B -q -T1 compile
{ java -Xmx48m -cp target/classes com.ankurm.interviewlab.dp.SpaceDemo 2>&1 | grep -v '^Picked up JAVA_TOOL_OPTIONS' ; } > output/12-space-demo.txt
echo "done:"; ls -1 output