add support for .jvmopts to the bash launcher

This commit is contained in:
Sam Halliday 2016-08-24 21:57:06 +01:00
parent daed09b8cd
commit 45badebcee
2 changed files with 13 additions and 8 deletions

View File

@ -72,10 +72,15 @@ add -X to sbt's scalacOptions (-S is stripped)
.RS
The user configuration file.
.RE
.I ".jvmopts"
.RS
if this file exists in the current directory, its contents are appended
to the JAVA_OPTS.
.RE
.I ".sbtopts"
.RS
if this file exists in the current directory, it is prepended to the
runner args.
if this file exists in the current directory, its contents are prepended
to the runner args.
.RE
.I "/etc/sbt/sbtopts"
.RS

View File

@ -94,9 +94,11 @@ Usage: $script_name [options]
# jvm options and output control
JAVA_OPTS environment variable, if unset uses "$java_opts"
.jvmopts if this file exists in the current directory, its contents
are appended to JAVA_OPTS
SBT_OPTS environment variable, if unset uses "$default_sbt_opts"
.sbtopts if this file exists in the current directory, it is
prepended to the runner args
.sbtopts if this file exists in the current directory, its contents
are prepended to the runner args
/etc/sbt/sbtopts if this file exists, it is prepended to the runner args
-Dkey=val pass -Dkey=val directly to the java runtime
-J-X pass option -X directly to the java runtime
@ -137,16 +139,14 @@ loadConfigFile() {
done
}
# TODO - Pull in config based on operating system... (MSYS + cygwin should pull in txt file).
# Here we pull in the global settings configuration.
[[ -f "$etc_sbt_opts_file" ]] && set -- $(loadConfigFile "$etc_sbt_opts_file") "$@"
# -- Windows behavior stub'd
# JAVA_OPTS=$(cat "$WDIR/sbtconfig.txt" | sed -e 's/\r//g' -e 's/^#.*$//g' | sed ':a;N;$!ba;s/\n/ /g')
# Pull in the project-level config file, if it exists.
[[ -f "$sbt_opts_file" ]] && set -- $(loadConfigFile "$sbt_opts_file") "$@"
# Pull in the project-level java config, if it exists.
[[ -f ".jvmopts" ]] && export JAVA_OPTS="$JAVA_OPTS $(loadConfigFile .jvmopts)"
run "$@"