#!/usr/bin/env bash # Compiles each file in src/broken/ against Jackson 3 and records the compiler's own message. # Output keeps each "error:" line with its source line and caret, and the error count (javac lists every candidate overload). # These files are deliberately NOT part of the Maven build (they live outside src/main). set -uo pipefail cd "$(dirname "$0")/.." CP="target/classes:$(cat target/cp.txt)" OUT=output/Broken-compile-errors.txt : > "$OUT" for f in src/broken/*.java; do echo "=== $(basename "$f") ===" >> "$OUT" tmp=$(mktemp -d) javac -Xlint:none -d "$tmp" -cp "$CP" "$f" 2>&1 | grep -vE "Picked up|^Note:" | sed "s#^src/broken/##" | awk '/error:/{c=3} c>0{print; c--} /^[0-9]+ errors?$/{print}' >> "$OUT" rm -rf "$tmp" echo >> "$OUT" done echo "wrote $OUT ($(wc -l < "$OUT") lines)"