Debian Codegraph @

checker/bin-devel/javac

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 javacJar=${binaryDir}/javac.jar
25
26 jdkPaths="${mydir}"/../jdk/annotated
27
28 cfDir="${mydir}"/../..
29 annoToolsDir="${cfDir}"/../annotation-tools
30 stubparserDir="${cfDir}"/../stubparser
31 classes="build/classes/java/main"
32 resources="build/resources/main"
33
34 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)`
35
36 ## Preserve quoting and spaces in arguments, which would otherwise be lost
37 ## due to being passed through the shell twice.
38 # Unset IFS and use newline as arg separator to preserve spaces in args
39 DUALCASE=1 # for MKS: make case statement case-sensitive (6709498)
40 saveIFS="$IFS"
41 nl='
42 '
43 for i in "$@" ; do
44 IFS=
45 args=$args$nl"'"$i"'"
46 IFS="$saveIFS"
47 done
48
49 # TODO: We really only want the qualifiers on the CP, but there is no
50 # easy way to determine them here. ../bin/javac can use
51 # checker-qual.jar, but it might not exist yet.
52 # Set .cp to all build directories for now.
53
54 # Add the following option for verbose output:
55 # "-DCheckerDevelMain.verbose=TRUE" \
56
57 eval "java" \
58 "-ea " \
59 "-DCheckerDevelMain.cp=${buildDirs} " \
60 "-DCheckerDevelMain.pp=${buildDirs} " \
61 "-DCheckerDevelMain.compile.bcp=${jdkPaths} " \
62 "-DCheckerDevelMain.runtime.cp=${javacJar} " \
63 "-DCheckerDevelMain.binary=${binaryDir} " \
64 "-classpath ${buildDirs} " \
65 "org.checkerframework.framework.util.CheckerDevelMain" \
66 ${args}