Debian Codegraph @

checker/bin-devel/javac-debug

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