Debian Codegraph @

repl

raw
1 #!/usr/bin/env bash
2 set -e
3 set -u
4 set -o pipefail
5
6 while getopts d OPTION "$@"; do
7 case $OPTION in
8 d)
9 set -x
10 ;;
11 esac
12 done
13
14 PROJECT_ROOT=$(dirname "${BASH_SOURCE[0]}")
15 cd "${PROJECT_ROOT}"
16
17 echo "Compiling and computing classpath (May take a while)"
18 # Sadly even with the --quiet option Gradle (or some component of)
19 # will print the number of warnings/errors to stdout if there are
20 # any.
21 GRADLE_CLASSPATH="$(gradle :minidns-repl:printClasspath --quiet |\
22 tail -n1)"
23 echo "Classpath computed, starting REPL"
24
25 java \
26 -ea \
27 -Dscala.usejavacp=true \
28 -classpath "${GRADLE_CLASSPATH}" \
29 ammonite.Main \
30 --predef minidns-repl/scala.repl