#!/usr/bin/env bash # Compiles the SAS 1.x-style configuration against the 7.1.1 classpath and records the # compiler's own words. The point is that the error text is what you will actually see, # not a paraphrase of it. set -u cd "$(dirname "$0")/.." OUT=../docs/output/as-legacy-compile-failure.txt mkdir -p ../docs/output mvn -B -q -pl auth-server dependency:build-classpath \ -Dmdep.outputFile=/tmp/as-cp.txt -DincludeScope=compile >/dev/null 2>&1 CP=$(cat /tmp/as-cp.txt) WORK=$(mktemp -d) mkdir -p "$WORK/com/ankurm/authserver/legacy" "$WORK/out" cp src-broken/LegacySasConfig.java.txt "$WORK/com/ankurm/authserver/legacy/LegacySasConfig.java" javac -nowarn -d "$WORK/out" -cp "$CP" \ "$WORK/com/ankurm/authserver/legacy/LegacySasConfig.java" > "$WORK/err.txt" 2>&1 STATUS=$? { echo "# The SAS 1.x configuration, compiled against Spring Boot 4.1.1 / Spring Security 7.1.1." echo "# Source: src-broken/LegacySasConfig.java.txt" echo echo "\$ javac -cp LegacySasConfig.java" echo sed "s|$WORK|.|g" "$WORK/err.txt" echo echo "javac exit status: $STATUS" } > "$OUT" rm -rf "$WORK" cat "$OUT"