Files
spring-boot-demo/log4j2-levels/scripts/run-all.sh
T

28 lines
835 B
Bash
Executable File

#!/usr/bin/env bash
# Regenerates every file under output/.
#
# ./scripts/run-all.sh
#
# Needs a JDK 25 and Maven 3.9. Transcripts 01-08 and 13 come out of the test suite, so each number in
# them is an assertion that fails the build if it stops being true. 09-12 are the packaged jar
# under real JVMs, driven with curl.
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p output
echo "== test suite (transcripts 01-08 and 13)"
mvn -B test | tee /tmp/log4j2-levels-mvn.log | grep -E '^\[(INFO|WARNING|ERROR)\] Tests run:' | sed 's/^\[[A-Z]*\] //' > output/00-test-summary.txt
echo "== packaged jar"
mvn -B -q package -DskipTests
echo "== live runs (transcripts 09-10)"
./scripts/live-run.sh
echo "== both loggers on the classpath, dependency trees (transcripts 11-12)"
./scripts/both-logging.sh
echo
echo "output:"
ls -1 output