diff --git a/src/linux/usr/share/man/man1/sbt.1 b/src/linux/usr/share/man/man1/sbt.1 index 27772cbdc..6dc5d7211 100644 --- a/src/linux/usr/share/man/man1/sbt.1 +++ b/src/linux/usr/share/man/man1/sbt.1 @@ -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 diff --git a/src/universal/bin/sbt b/src/universal/bin/sbt index 632d45fd5..d622f98ef 100755 --- a/src/universal/bin/sbt +++ b/src/universal/bin/sbt @@ -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 "$@"