blob: c452d390504c883e201cc6b2fd1d48bfeed8ae56 [file] [log] [blame]
#!/bin/sh
# Extract annotations from a class file and write them to an annotation file.
# For usage information, run: extract-annotations --help
# See the Annotation File Utilities documentation for more information.
# If the very first argument is "--debug-script", debug this script (but
# don't pass --debug-script to the underlying program).
DEBUG=0
if [ "$1" = "--debug-script" ]; then
DEBUG=1
shift 1
fi
AFU=${AFU:-$(dirname $0)/..}
ANNOTATION_FILE_UTILS=${AFU}/bin:${AFU}/../scene-lib/bin:${AFU}/../asmx/bin:${AFU}/annotation-file-utilities.jar
LANGTOOLS=${LANGTOOLS:-${AFU}/../../jsr308-langtools}
JAVAC_JAR=${JAVAC_JAR:-${LANGTOOLS}/dist/lib/javac.jar}
if [ "$DEBUG" = "1" ]; then
echo "--- start of extract-annotations debugging output"
echo "AFU=${AFU}"
echo "ANNOTATION_FILE_UTILS=${ANNOTATION_FILE_UTILS}"
echo "LANGTOOLS=${LANGTOOLS}"
echo "JAVAC_JAR=${JAVAC_JAR}"
# Keep this in sync with the actual command below.
echo java -ea -cp ${JAVAC_JAR}:${AFU}/lib/plume-core.jar:${ANNOTATION_FILE_UTILS}:${CLASSPATH} annotations.io.classfile.ClassFileReader "$@"
echo "--- end of extract-annotations debugging output"
fi
# Needs CLASSPATH to find user files
java -ea -cp ${JAVAC_JAR}:${AFU}/lib/plume-core.jar:${ANNOTATION_FILE_UTILS}:${CLASSPATH} annotations.io.classfile.ClassFileReader "$@"