Mercury-IMs fork of [jxmpp](
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
895 B

#!/usr/bin/env bash
set -e
set -u
set -o pipefail
while getopts d OPTION "$@"; do
case $OPTION in
set -x
PROJECT_ROOT=$(dirname "${BASH_SOURCE[0]}")
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