-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
608 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
@echo off | ||
|
||
set DIRNAME=%~dp0% | ||
set ROOTDIR=%DIRNAME%\.. | ||
set TARGETDIR=%DIRNAME%target | ||
|
||
rem initialization | ||
if not exist %TARGETDIR%\lib ( | ||
echo Build jline with maven before running the demo | ||
goto END | ||
) | ||
|
||
goto :SETUP_CLASSPATH | ||
|
||
: APPEND_TO_CLASSPATH | ||
set filename=%~1 | ||
set cp=%cp%;%TARGETDIR%\lib\%filename% | ||
goto :EOF | ||
|
||
:SETUP_CLASSPATH | ||
set cp=%TARGETDIR%\classes | ||
rem JLINE | ||
pushd %TARGETDIR%\lib | ||
for %%G in (jline-*.jar) do call:APPEND_TO_CLASSPATH %%G | ||
rem Groovy | ||
for %%G in (groovy-*.jar) do call:APPEND_TO_CLASSPATH %%G | ||
|
||
set "opts=%JLINE_OPTS%" | ||
set "logconf=%DIRNAME%etc\logging.properties" | ||
:RUN_LOOP | ||
if "%1" == "jansi" goto :EXECUTE_JANSI | ||
if "%1" == "jna" goto :EXECUTE_JNA | ||
if "%1" == "debug" goto :EXECUTE_DEBUG | ||
if "%1" == "debugs" goto :EXECUTE_DEBUGS | ||
if "%1" == "verbose" goto :EXECUTE_VERBOSE | ||
if "%1" == "" goto :EXECUTE_MAIN | ||
set "opts=%opts% %~1" | ||
shift | ||
goto :RUN_LOOP | ||
|
||
:EXECUTE_JANSI | ||
for %%G in (jansi-*.jar) do call:APPEND_TO_CLASSPATH %%G | ||
shift | ||
goto :RUN_LOOP | ||
|
||
:EXECUTE_JNA | ||
for %%G in (jna-*.jar) do call:APPEND_TO_CLASSPATH %%G | ||
shift | ||
goto :RUN_LOOP | ||
|
||
:EXECUTE_DEBUG | ||
set "opts=%opts% -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" | ||
shift | ||
goto :RUN_LOOP | ||
|
||
:EXECUTE_DEBUGS | ||
set "opts=%opts% -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" | ||
shift | ||
goto :RUN_LOOP | ||
|
||
:EXECUTE_VERBOSE | ||
set "logconf=%DIRNAME%etc\logging-verbose.properties" | ||
shift | ||
goto :RUN_LOOP | ||
|
||
:EXECUTE_MAIN | ||
popd | ||
|
||
rem Launching Groovy REPL... | ||
echo Launching Groovy REPL... | ||
echo Classpath: %cp% | ||
java -cp %cp% %opts% -Dgosh.home=%DIRNAME% -Djava.util.logging.config.file=%logconf% org.jline.demo.Repl | ||
|
||
:END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/sh | ||
|
||
realpath() { | ||
OURPWD=${PWD} | ||
cd "$(dirname "${1}")" | ||
LINK=$(readlink "$(basename "${1}")") | ||
while [ "${LINK}" ]; do | ||
cd "$(dirname "${LINK}")" | ||
LINK=$(readlink "$(basename "${1}")") | ||
done | ||
REALPATH="${PWD}/$(basename "${1}")" | ||
cd "${OURPWD}" | ||
echo "${REALPATH}" | ||
} | ||
|
||
REALNAME=$(realpath "$0") | ||
DIRNAME=$(dirname "${REALNAME}") | ||
PROGNAME=$(basename "${REALNAME}") | ||
ROOTDIR=${DIRNAME}/.. | ||
TARGETDIR=${DIRNAME}/target | ||
|
||
if [ ! -e ${TARGETDIR}/lib ] ; then | ||
echo "Build jline with maven before running the demo" | ||
exit | ||
fi; | ||
|
||
cp=${TARGETDIR}/classes | ||
# JLINE | ||
cp=${cp}$(find ${TARGETDIR}/lib -name "jline-*.jar" -exec printf :{} ';') | ||
cp=${cp}$(find ${TARGETDIR}/lib -name "groovy-*.jar" -exec printf :{} ';') | ||
|
||
opts="${JLINE_OPTS}" | ||
logconf="${DIRNAME}/etc/logging.properties" | ||
while [ "${1}" != "" ]; do | ||
case ${1} in | ||
'debug') | ||
opts="${opts} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" | ||
shift | ||
;; | ||
'debugs') | ||
opts="${opts} -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" | ||
shift | ||
;; | ||
'jansi') | ||
cp=${cp}$(find ${TARGETDIR}/lib -name "jansi-*.jar" -exec printf :{} ';') | ||
shift | ||
;; | ||
'jna') | ||
cp=${cp}$(find ${TARGETDIR}/lib -name "jna-*.jar" -exec printf :{} ';') | ||
shift | ||
;; | ||
'verbose') | ||
logconf="${DIRNAME}/etc/logging-verbose.properties" | ||
shift | ||
;; | ||
*) | ||
opts="${opts} ${1}" | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
cygwin=false | ||
mingw=false | ||
case "$(uname)" in | ||
CYGWIN*) | ||
cygwin=true | ||
;; | ||
MINGW*) | ||
mingw=true | ||
;; | ||
esac | ||
if ${cygwin}; then | ||
cp=$(cygpath --path --windows "${cp}") | ||
DIRNAME=$(cygpath --path --windows "${DIRNAME}") | ||
fi | ||
|
||
nothing() { | ||
# nothing to do here | ||
a=a | ||
} | ||
trap 'nothing' TSTP | ||
|
||
# Launch Groovy REPL | ||
echo "Launching Groovy REPL..." | ||
echo "Classpath: $cp" | ||
set mouse=a | ||
java -cp $cp \ | ||
$opts \ | ||
-Dgosh.home="${DIRNAME}" \ | ||
-Djava.util.logging.config.file="${logconf}" \ | ||
org.jline.demo.Repl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.