-
Notifications
You must be signed in to change notification settings - Fork 5
/
run-dljc.sh
executable file
·55 lines (38 loc) · 1.53 KB
/
run-dljc.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
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
set -e
WORKING_DIR=$(pwd)
if [ -z "${JSR308}" ] ; then
export JSR308=$(cd $(dirname "$0")/.. && pwd)
fi
DLJC=$JSR308/do-like-javac
export AFU=$JSR308/annotation-tools/annotation-file-utilities
export PATH=$PATH:$AFU/scripts
CFI=$JSR308/checker-framework-inference
SECURITYPATH=$JSR308/security-demo/build/classes/java/main
export CLASSPATH=$SECURITYPATH
CFI_LIB=$CFI/lib
export DYLD_LIBRARY_PATH=$CFI_LIB
export LD_LIBRARY_PATH=$CFI_LIB
CHECKER=security.SecurityChecker
SOLVER=security.solver.SecuritySolverEngine
#parsing build command of the target program
build_cmd="$1"
shift
while [ "$#" -gt 0 ]
do
build_cmd="$build_cmd $1"
shift
done
cd "$WORKING_DIR"
infer_cmd="python3 $DLJC/dljc -t inference --guess --crashExit --checker $CHECKER --solver $SOLVER --solverArgs=\"collectStatistics=true\" -o logs -m INFER -afud $WORKING_DIR/annotated -- $build_cmd "
# debug_onlyCompile="--onlyCompileBytecodeBase true"
debug_cmd="python3 $DLJC/dljc -t testminimizer --annotationClassPath $SECURITYPATH $debug_onlyCompile --expectOutputRegex 'Z3 Unsatisfiable' --checker $CHECKER --solver $SOLVER --solverArgs=\"collectStatistics=true\" -o logs -m INFER -afud $WORKING_DIR/annotated -- $build_cmd "
running_cmd=$infer_cmd
echo "============ Important variables ============="
echo "JSR308: $JSR308"
echo "CLASSPATH: $CLASSPATH"
echo "build cmd: $build_cmd"
echo "running cmd: $running_cmd"
echo "============================================="
eval "$running_cmd"
echo "---- Reminder: do not forget to clean up the project! ----"