1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00
Smack/repl
Florian Schmaus f351919fa5 Switch to Ammonite REPL
It comes with working tab completion. \o/
2016-02-23 16:30:20 +01:00

30 lines
844 B
Bash
Executable file

#!/usr/bin/env bash
set -e
set -u
set -o pipefail
while getopts d OPTION "$@"; do
case $OPTION in
d)
set -x
;;
esac
done
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
declare -r GRADLE_CLASSPATH="$(gradle :smack-repl:printClasspath --quiet |\
tail -n1)"
echo "Finished, starting REPL"
java \
-Dscala.usejavacp=true \
-classpath "${GRADLE_CLASSPATH}" \
ammonite.repl.Main \
-f smack-repl/scala.repl