mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-25 15:52:06 +01:00
REPL: Add support to enable a JDWP debug link
This commit is contained in:
parent
01aa6d9c18
commit
e1e12031ac
1 changed files with 16 additions and 2 deletions
18
repl
18
repl
|
@ -3,15 +3,29 @@ set -e
|
||||||
set -u
|
set -u
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
JDWP=false
|
||||||
|
JDWP_PORT=8000
|
||||||
|
|
||||||
while getopts d OPTION "$@"; do
|
while getopts djp: OPTION "$@"; do
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
d)
|
d)
|
||||||
set -x
|
set -x
|
||||||
;;
|
;;
|
||||||
|
j)
|
||||||
|
JDWP=true
|
||||||
|
;;
|
||||||
|
p)
|
||||||
|
JDWP_PORT=$OPTARG
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
EXTRA_JAVA_ARGS=()
|
||||||
|
if $JDWP; then
|
||||||
|
EXTRA_JAVA_ARGS+=("-Xdebug")
|
||||||
|
EXTRA_JAVA_ARGS+=("-Xrunjdwp:server=y,transport=dt_socket,address=${JDWP_PORT},suspend=n")
|
||||||
|
fi
|
||||||
|
|
||||||
PROJECT_ROOT=$(dirname "${BASH_SOURCE[0]}")
|
PROJECT_ROOT=$(dirname "${BASH_SOURCE[0]}")
|
||||||
cd "${PROJECT_ROOT}"
|
cd "${PROJECT_ROOT}"
|
||||||
|
|
||||||
|
@ -27,7 +41,7 @@ GRADLE_CLASSPATH="$(gradle :smack-repl:printClasspath --quiet |\
|
||||||
tail -n1)"
|
tail -n1)"
|
||||||
echo "Finished, starting REPL"
|
echo "Finished, starting REPL"
|
||||||
|
|
||||||
java \
|
java "${EXTRA_JAVA_ARGS[@]}" \
|
||||||
-Dscala.usejavacp=true \
|
-Dscala.usejavacp=true \
|
||||||
-classpath "${GRADLE_CLASSPATH}" \
|
-classpath "${GRADLE_CLASSPATH}" \
|
||||||
ammonite.Main \
|
ammonite.Main \
|
||||||
|
|
Loading…
Reference in a new issue