Files
spring-auth-demo/security-7-migration/scripts/compile-old-apis.sh
T

19 lines
938 B
Bash
Executable File

#!/usr/bin/env bash
# Compiles src/compat/*.java against Security 6.5.11 and 7.1.2 and records javac's answer in output/.
set -u
cd "$(dirname "$0")/.."
mkdir -p target output
for pair in "security6:6.5.11" "security7:7.1.2"; do
profile=${pair%%:*}; v=${pair##*:}
mvn -q -B dependency:build-classpath -P$profile -Dmdep.outputFile=target/cp-$v.txt >/dev/null || { echo "classpath failed for $v"; exit 1; }
for f in OldSecurity NewSecurity NewManager; do
out=output/$( [ $f = OldSecurity ] && echo 05-old-apis || { [ $f = NewSecurity ] && echo 06-fixed-apis || echo 07-new-manager; } )-$v.txt
rm -rf target/classes-$f-$v; mkdir -p target/classes-$f-$v
{
echo "Spring Security $v, compiling $f.java"
javac -Xlint:deprecation -proc:none -d target/classes-$f-$v -cp "$(cat target/cp-$v.txt)" src/compat/$f.java 2>&1 | grep -v "^Picked up"
echo "javac exit status: ${PIPESTATUS[0]}"
} > $out
done
done