-
Notifications
You must be signed in to change notification settings - Fork 5
/
check.sh
executable file
·43 lines (34 loc) · 1.09 KB
/
check.sh
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
#!/bin/bash
set -e
# Environment
export JSR308=$(cd $(dirname "$0")/.. && pwd)
export CF=$JSR308/checker-framework
export CFI=$JSR308/checker-framework-inference
export JAVAC=$CF/checker/bin/javac
export PICO=$(cd $(dirname "$0") && pwd)
# Dependencies
export CLASSPATH=$PICO/build/classes/java/main:$CFI/dist/checker-framework-inference.jar
# Command
DEBUG=""
CHECKER="pico.typecheck.PICOChecker"
declare -a ARGS
for i in "$@" ; do
if [[ $i == "-d" ]] ; then
echo "Typecheck using debug mode. Listening at port 5050. Waiting for connection...."
DEBUG="-J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5050"
continue
fi
if [[ $i == "-i" ]] ; then
echo "Typecheck using PICOInferenceChecker typechecking mode"
CHECKER="pico.inference.PICOInferenceChecker"
continue
fi
ARGS[${#ARGS[@]}]="$i"
done
cmd=""
if [ "$DEBUG" == "" ]; then
cmd="$JAVAC -cp "${CLASSPATH}" -processor "${CHECKER}" "${ARGS[@]}""
else
cmd="$JAVAC "$DEBUG" -cp "${CLASSPATH}" -processor "${CHECKER}" -AatfDoNotCache "${ARGS[@]}""
fi
eval "$cmd"