Created
April 10, 2018 20:34
-
-
Save raelik/99c8e72bed6cc725c8c22b498a60656c to your computer and use it in GitHub Desktop.
jRuby custom launchers
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
#!/usr/bin/env bash | |
ARTIFACT="artifact" | |
COMMAND=$(basename $0) | |
COMMAND=${COMMAND/j-/} # Remove the leading 'j-' from the command name | |
BASE_PATH=${BASH_SOURCE%/*} | |
DEBUG= | |
if [ "$COVERAGE" == "true" ]; then | |
DEBUG="--debug" | |
fi | |
if [ "$BASE_PATH" != "$0" ]; then | |
cd $BASE_PATH/.. | |
else | |
cd .. | |
fi | |
JAVA_CMD="java -d64 -server -Xms${JRUBY_XMS:-64M} -Xmx${JRUBY_XMX:-128M} -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseCodeCacheFlushing -Djruby.compile.invokedynamic=true -jar build/libs/${ARTIFACT}-jruby.jar -C" | |
export RUBYOPT="" | |
export JARS_LOCK=uri:classloader://Jars.lock | |
exec $JAVA_CMD $PWD $DEBUG -S $COMMAND "$@" |
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
#!/usr/bin/env bash | |
ARTIFACT="artifact" | |
COMMAND=`basename $0` | |
BASE_PATH=${BASH_SOURCE%/*} | |
if [ "$BASE_PATH" != "$0" ]; then | |
cd $BASE_PATH/.. | |
else | |
cd .. | |
fi | |
JAVA_CMD="java -d64 -server -Xms${JRUBY_XMS:-256M} -Xmx${JRUBY_XMX:-384M} -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseCodeCacheFlushing -Djruby.compile.invokedynamic=true -jar build/libs/${ARTIFACT}-jruby.jar -C" | |
export RUBYOPT="" | |
export JARS_LOCK=uri:classloader://Jars.lock | |
exec $JAVA_CMD $PWD lib/$COMMAND.rb "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment