3434
3535set -o pipefail
3636
37- declare -r sbt_release_version=" 1.5.5 "
38- declare -r sbt_unreleased_version=" 1.5.5 "
37+ declare -r sbt_release_version=" 1.8.0 "
38+ declare -r sbt_unreleased_version=" 1.8.0 "
3939
40- declare -r latest_213=" 2.13.6 "
41- declare -r latest_212=" 2.12.14 "
40+ declare -r latest_213=" 2.13.10 "
41+ declare -r latest_212=" 2.12.17 "
4242declare -r latest_211=" 2.11.12"
4343declare -r latest_210=" 2.10.7"
4444declare -r latest_29=" 2.9.3"
@@ -216,7 +216,8 @@ getJavaVersion() {
216216 # but on 9 and 10 it's 9.x.y and 10.x.y.
217217 if [[ " $str " =~ ^1\. ([0-9]+)(\. .* )? $ ]]; then
218218 echo " ${BASH_REMATCH[1]} "
219- elif [[ " $str " =~ ^([0-9]+)(\. .* )? $ ]]; then
219+ # Fixes https://github.com/dwijnand/sbt-extras/issues/326
220+ elif [[ " $str " =~ ^([0-9]+)(\. .* )? (-ea)? $ ]]; then
220221 echo " ${BASH_REMATCH[1]} "
221222 elif [[ -n " $str " ]]; then
222223 echoerr " Can't parse java version from: $str "
@@ -252,7 +253,9 @@ is_apple_silicon() { [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]]
252253# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
253254default_jvm_opts () {
254255 local -r v=" $( java_version) "
255- if [[ $v -ge 10 ]]; then
256+ if [[ $v -ge 17 ]]; then
257+ echo " $default_jvm_opts_common "
258+ elif [[ $v -ge 10 ]]; then
256259 if is_apple_silicon; then
257260 # As of Dec 2020, JVM for Apple Silicon (M1) doesn't support JVMCI
258261 echo " $default_jvm_opts_common "
@@ -385,12 +388,10 @@ usage() {
385388 set_sbt_version
386389 cat << EOM
387390Usage: $script_name [options]
388-
389391Note that options which are passed along to sbt begin with -- whereas
390392options to this runner use a single dash. Any sbt command can be scheduled
391393to run first by prefixing the command with --, so --warn, --error and so on
392394are not special.
393-
394395 -h | -help print this message
395396 -v verbose operation (this runner is chattier)
396397 -d, -w, -q aliases for --debug, --warn, --error (q means quiet)
@@ -408,15 +409,13 @@ are not special.
408409 -batch Disable interactive mode
409410 -prompt <expr> Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted
410411 -script <file> Run the specified file as a scala script
411-
412412 # sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version )
413413 -sbt-version <version> use the specified version of sbt (default: $sbt_release_version )
414414 -sbt-force-latest force the use of the latest release of sbt: $sbt_release_version
415415 -sbt-dev use the latest pre-release version of sbt: $sbt_unreleased_version
416416 -sbt-jar <path> use the specified jar as the sbt launcher
417417 -sbt-launch-dir <path> directory to hold sbt launchers (default: $sbt_launch_dir )
418418 -sbt-launch-repo <url> repo url for downloading sbt launcher jar (default: $( url_base " $sbt_version " ) )
419-
420419 # scala version (default: as chosen by sbt)
421420 -28 use $latest_28
422421 -29 use $latest_29
@@ -427,10 +426,8 @@ are not special.
427426 -scala-home <path> use the scala build at the specified directory
428427 -scala-version <version> use the specified version of scala
429428 -binary-version <version> use the specified scala version when searching for dependencies
430-
431429 # java version (default: java from PATH, currently $( java -version 2>&1 | grep version) )
432430 -java-home <path> alternate JAVA_HOME
433-
434431 # passing options to the jvm - note it does NOT use JAVA_OPTS due to pollution
435432 # The default set is used if JVM_OPTS is unset and no -jvm-opts file is found
436433 <default> $( default_jvm_opts)
@@ -440,14 +437,12 @@ are not special.
440437 -jvm-opts <path> file containing jvm args (if not given, .jvmopts in project root is used if present)
441438 -Dkey=val pass -Dkey=val directly to the jvm
442439 -J-X pass option -X directly to the jvm (-J is stripped)
443-
444440 # passing options to sbt, OR to this runner
445441 SBT_OPTS environment variable holding either the sbt args directly, or
446442 the reference to a file containing sbt args if given path is prepended by '@' (e.g. '@/etc/sbtopts')
447443 Note: "@"-file is overridden by local '.sbtopts' or '-sbt-opts' argument.
448444 -sbt-opts <path> file containing sbt args (if not given, .sbtopts in project root is used if present)
449445 -S-X add -X to sbt's scalacOptions (-S is stripped)
450-
451446 # passing options exclusively to this runner
452447 SBTX_OPTS environment variable holding either the sbt-extras args directly, or
453448 the reference to a file containing sbt-extras args if given path is prepended by '@' (e.g. '@/etc/sbtxopts')
600595$( pwd) doesn't appear to be an sbt project.
601596If you want to start sbt anyway, run:
602597 $0 -sbt-create
603-
604598EOM
605599 exit 1
606600}
0 commit comments