#!/usr/bin/env bash # Which attributes exist in which 7.0.x release, read by reflection from the jars themselves. # Needs spring-context/spring-core 7.0.0-7.0.3 in the local repository, e.g. # mvn dependency:get -Dartifact=org.springframework:spring-context:7.0.0 (and 7.0.1, 7.0.2, 7.0.3, # plus the matching spring-core) # -> docs/output/api-surface.txt set -uo pipefail source "$(dirname "$0")/env.sh" M2="${M2:-$HOME/.m2/repository}" S="$M2/org/springframework" cat > /tmp/api-surface.jsh <<'JSH' String attrs(Class c) { var s = new java.util.TreeSet(); for (var m : c.getDeclaredMethods()) if (java.lang.reflect.Modifier.isPublic(m.getModifiers())) s.add(m.getName()); return s.toString(); } System.out.println(" @Retryable " + attrs(org.springframework.resilience.annotation.Retryable.class)); System.out.println(" @ConcurrencyLimit " + attrs(org.springframework.resilience.annotation.ConcurrencyLimit.class)); System.out.println(" RetryPolicy.Builder " + attrs(org.springframework.core.retry.RetryPolicy.Builder.class)); System.out.println(" RetryListener " + attrs(org.springframework.core.retry.RetryListener.class)); /exit JSH { echo "# Public API of the resilience support, per Spring Framework release" for v in 7.0.0 7.0.1 7.0.2 7.0.3 7.0.9; do echo; echo "## $v" CP="$S/spring-context/$v/spring-context-$v.jar:$S/spring-core/$v/spring-core-$v.jar:$S/spring-aop/7.0.9/spring-aop-7.0.9.jar:$S/spring-beans/7.0.9/spring-beans-7.0.9.jar:$(ls "$M2"/org/jspecify/jspecify/*/jspecify-*.jar | head -1)" jshell --class-path "$CP" -q /tmp/api-surface.jsh 2>&1 | grep -v 'Picked up' | sed 's/^jshell> //' done } > "$OUT/api-surface.txt" cat "$OUT/api-surface.txt"