Files
java-core-examples/completablefuture/scripts/run-all.sh
T

19 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Regenerates every file in output/. Needs a JDK 25 on PATH (or JAVA_HOME set to one).
# 03 (join counts) and 07 (timings) drift between runs and depend on core count: indicative only.
set -euo pipefail
cd "$(dirname "$0")/.."
mvn -q -B compile 2>&1 | grep -v -e '^WARNING' -e '^Picked up' || true
mkdir -p output
run() { java -cp target/classes "com.ankurm.completablefuture.$1" 2>&1 | grep -v -e '^Picked up JAVA_TOOL_OPTIONS' -e '^Picked up _JAVA_OPTIONS' > "output/$2.txt"; echo "==> $2"; }
run ThenApplyVsComposeDemo 01-thenapply-vs-thencompose
run WhichThreadDemo 02-which-thread
run JoinHelpsDemo 03-join-helps
run ExceptionHandlingDemo 04-exception-handling
run TimeoutDemo 05-timeouts-and-cancel
run AllOfAnyOfDemo 06-allof-anyof
run VirtualThreadsBenchmark 07-virtual-threads-timings
./scripts/compile-broken.sh
mvn -B test 2>&1 | grep -E 'Tests run:|BUILD|ERROR|FAIL' | grep -v 'Picked up' > output/09-tests.txt
echo "regenerated:"; ls output