File: repl

package info (click to toggle)
libjxmpp-java 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 904 kB
  • sloc: java: 5,826; xml: 687; sh: 21; python: 11; makefile: 9
file content (34 lines) | stat: -rwxr-xr-x 895 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash
set -e
set -u
set -o pipefail


while getopts d OPTION "$@"; do
    case $OPTION in
	d)
	    set -x
	    ;;
    esac
done

PROJECT_ROOT=$(dirname "${BASH_SOURCE[0]}")
cd "${PROJECT_ROOT}"

echo "Compiling and computing classpath (May take a while)"
# Sadly even with the --quiet option Gradle (or some component of)
# will print the number of warnings/errors to stdout if there are
# any. So the result could look like
# 52 warnings\n1 warning\n12 warnings\n
# /smack/smack-repl/build/classes/main:/smack/smack-repl/build/
# resources/main:/smack/smack-tcp/build/libs/smack-tcp-4.2.0-alpha4-SNAPSHOT.jar
# So perform a "tail -n1" on the output of gradle
GRADLE_CLASSPATH="$(gradle :jxmpp-repl:printClasspath --quiet |\
	tail -n1)"
echo "Finished, starting REPL"

java \
	-Dscala.usejavacp=true \
	-classpath "${GRADLE_CLASSPATH}" \
	ammonite.Main \
	-f jxmpp-repl/scala.repl