Files

24 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Compiles src/compat/OldApis.java against the JUnit 5.14.4 jars and then the 6.1.3 jars and records the compiler's answer.
# Run scripts/api_diff.py first: it downloads the jars into target/jars.
set -uo pipefail
cd "$(dirname "$0")/.."
unset JAVA_TOOL_OPTIONS
mkdir -p output target/compat
J=target/jars
[ -f "$J/apiguardian-api-1.1.2.jar" ] || curl -sSf --retry 5 -o "$J/apiguardian-api-1.1.2.jar" \
https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar
compile() { # $1 = label, $2 = jupiter version, $3 = platform version
for src in OldApis:05-old-apis FixedApis:06-fixed-apis; do
{
echo "JUnit $2, compiling ${src%%:*}.java"
javac -Xlint:deprecation --release 17 -d "target/compat/$1" \
-cp "$J/junit-jupiter-api-$2.jar:$J/junit-platform-commons-$3.jar:$J/apiguardian-api-1.1.2.jar" "src/compat/${src%%:*}.java" 2>&1 \
| sed -e '/^Picked up/d'
echo "javac exit status: ${PIPESTATUS[0]}"
} > "output/${src##*:}-$2.txt"
done
}
compile junit5 5.14.4 1.14.4
compile junit6 6.1.3 6.1.3