1 #!/bin/sh 2 3 # Insert annotations (from an annotation file) into a class file. 4 # For usage information, run: insert-annotations --help 5 # See the Annotation File Utilities documentation for more information. 6 7 # If the very first argument is "--debug-script", debug this script (but 8 # don't pass --debug-script to the underlying program). 9 DEBUG=0 10 if [ "$1" = "--debug-script" ]; then 11 DEBUG=1 12 shift 1 13 fi 14 15 AFU=${AFU:-$(dirname $0)/..} 16 ANNOTATION_FILE_UTILS=${AFU}/bin:${AFU}/../scene-lib/bin:${AFU}/../asmx/bin:${AFU}/annotation-file-utilities.jar 17 LANGTOOLS=${LANGTOOLS:-${AFU}/../../jsr308-langtools} 18 JAVAC_JAR=${JAVAC_JAR:-${LANGTOOLS}/dist/lib/javac.jar} 19 20 if [ "$DEBUG" = "1" ]; then 21 echo "--- start of insert-annotations debugging output" 22 echo "AFU=${AFU}" 23 echo "ANNOTATION_FILE_UTILS=${ANNOTATION_FILE_UTILS}" 24 echo "LANGTOOLS=${LANGTOOLS}" 25 echo "JAVAC_JAR=${JAVAC_JAR}" 26 # Keep this in sync with the actual command below. 27 echo "java -ea -cp ${JAVAC_JAR}:${AFU}/lib/plume-lib.jar:${ANNOTATION_FILE_UTILS}:${CLASSPATH} annotations.io.classfile.ClassFileWriter $@" 28 echo "--- end of insert-annotations debugging output" 29 fi 30 31 # Needs CLASSPATH to find user files 32 java -ea -cp ${JAVAC_JAR}:${AFU}/lib/plume-lib.jar:${ANNOTATION_FILE_UTILS}:${CLASSPATH} annotations.io.classfile.ClassFileWriter "$@" 33