1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/sh
#
# This file simply redirects all passed arguments
# to org.checkerframework.framework.util.CheckerDevelMain
#
# This script loads the .class files found in the
# build directory before it uses any jar files.
# Thus, a user can just do
# ./gradlew compileJava
# to debug changes rather than creating .jar files with "./gradlew assemble".
# When editing, keep this file in sync with javac-debug in this directory.
mydir="`dirname $0`"
case `uname -s` in
CYGWIN*)
mydir=`cygpath -m $mydir`
;;
esac
binaryDir="${mydir}"/../dist
javacJar=${binaryDir}/javac.jar
jdkPaths="${mydir}"/../jdk/annotated
cfDir="${mydir}"/../..
annoToolsDir="${cfDir}"/../annotation-tools
stubparserDir="${cfDir}"/../stubparser
classes="build/classes/java/main"
resources="build/resources/main"
buildDirs="${cfDir}"/dataflow/"${classes}":"${cfDir}"/javacutil/"${classes}":"${cfDir}"/framework/"${classes}":"${cfDir}"/framework/"${resources}":"${cfDir}"/checker/"${classes}":"${cfDir}"/checker/"${resources}":"${stubparserDir}"/javaparser-core/stubparser.jar:"${annoToolsDir}"/scene-lib/bin:"${annoToolsDir}"/annotation-file-utilities/annotation-file-utilities-all.jar:`(cd ${cfDir} && ./gradlew -q :checker:printPlumeUtilJarPath)`
## Preserve quoting and spaces in arguments, which would otherwise be lost
## due to being passed through the shell twice.
# Unset IFS and use newline as arg separator to preserve spaces in args
DUALCASE=1 # for MKS: make case statement case-sensitive (6709498)
saveIFS="$IFS"
nl='
'
for i in "$@" ; do
IFS=
args=$args$nl"'"$i"'"
IFS="$saveIFS"
done
# TODO: We really only want the qualifiers on the CP, but there is no
# easy way to determine them here. ../bin/javac can use
# checker-qual.jar, but it might not exist yet.
# Set .cp to all build directories for now.
# Add the following option for verbose output:
# "-DCheckerDevelMain.verbose=TRUE" \
eval "java" \
"-ea " \
"-DCheckerDevelMain.cp=${buildDirs} " \
"-DCheckerDevelMain.pp=${buildDirs} " \
"-DCheckerDevelMain.compile.bcp=${jdkPaths} " \
"-DCheckerDevelMain.runtime.cp=${javacJar} " \
"-DCheckerDevelMain.binary=${binaryDir} " \
"-classpath ${buildDirs} " \
"org.checkerframework.framework.util.CheckerDevelMain" \
${args}
|