@@ -23,13 +23,12 @@ declare -r sbt_launch_ivy_snapshot_repo="https://repo.scala-sbt.org/scalasbt/ivy
2323declare -r sbt_launch_mvn_release_repo=" https://repo.scala-sbt.org/scalasbt/maven-releases"
2424declare -r sbt_launch_mvn_snapshot_repo=" https://repo.scala-sbt.org/scalasbt/maven-snapshots"
2525
26- declare -r default_jvm_opts_common=" -Xms512m -Xss2m"
26+ declare -r default_jvm_opts_common=" -Xms512m -Xss2m -XX:MaxInlineLevel=18 "
2727declare -r noshare_opts=" -Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy"
2828
2929declare sbt_jar sbt_dir sbt_create sbt_version sbt_script sbt_new
3030declare sbt_explicit_version
3131declare verbose noshare batch trace_level
32- declare debugUs
3332
3433declare java_cmd=" java"
3534declare sbt_launch_dir=" $HOME /.sbt/launchers"
@@ -222,7 +221,9 @@ java_version() {
222221# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
223222default_jvm_opts () {
224223 local -r v=" $( java_version) "
225- if [[ $v -ge 8 ]]; then
224+ if [[ $v -ge 10 ]]; then
225+ echo " $default_jvm_opts_common -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler"
226+ elif [[ $v -ge 8 ]]; then
226227 echo " $default_jvm_opts_common "
227228 else
228229 echo " -XX:MaxPermSize=384m $default_jvm_opts_common "
@@ -357,12 +358,6 @@ options to this runner use a single dash. Any sbt command can be scheduled
357358to run first by prefixing the command with --, so --warn, --error and so on
358359are not special.
359360
360- Output filtering: if there is a file in the home directory called .sbtignore
361- and this is not an interactive sbt session, the file is treated as a list of
362- bash regular expressions. Output lines which match any regex are not echoed.
363- One can see exactly which lines would have been suppressed by starting this
364- runner with the -x option.
365-
366361 -h | -help print this message
367362 -v verbose operation (this runner is chattier)
368363 -d, -w, -q aliases for --debug, --warn, --error (q means quiet)
@@ -440,7 +435,7 @@ process_args() {
440435 -d) addSbt " --debug" && shift ;;
441436 -w) addSbt " --warn" && shift ;;
442437 -q) addSbt " --error" && shift ;;
443- -x) debugUs=true && shift ;;
438+ -x) shift ;; # currently unused
444439 -trace) require_arg integer " $1 " " $2 " && trace_level=" $2 " && shift 2 ;;
445440 -debug-inc) addJava " -Dxsbt.inc.debug=true" && shift ;;
446441
606601# traceLevel is 0.12+
607602[[ -n " $trace_level " ]] && setTraceLevel
608603
609- main () {
610- execRunner " $java_cmd " \
611- " ${extra_jvm_opts[@]} " \
612- " ${java_args[@]} " \
613- -jar " $sbt_jar " \
614- " ${sbt_commands[@]} " \
615- " ${residual_args[@]} "
616- }
617-
618- # sbt inserts this string on certain lines when formatting is enabled:
619- # val OverwriteLine = "\r\u001BM\u001B[2K"
620- # ...in order not to spam the console with a million "Resolving" lines.
621- # Unfortunately that makes it that much harder to work with when
622- # we're not going to print those lines anyway. We strip that bit of
623- # line noise, but leave the other codes to preserve color.
624- mainFiltered () {
625- local -r excludeRegex=$( grep -E -v ' ^#|^$' ~ /.sbtignore | paste -sd' |' -)
626-
627- echoLine () {
628- local -r line=" $1 "
629- local -r line1=" ${line// \r\x 1BM\x 1B\[ 2K// g} " # This strips the OverwriteLine code.
630- local -r line2=" ${line1// \x 1B\[ [0-9;]* [JKmsu]// g} " # This strips all codes - we test regexes against this.
631-
632- if [[ $line2 =~ $excludeRegex ]]; then
633- [[ -n $debugUs ]] && echo " [X] $line1 "
634- else
635- [[ -n $debugUs ]] && echo " $line1 " || echo " $line1 "
636- fi
637- }
638-
639- echoLine " Starting sbt with output filtering enabled."
640- main | while read -r line; do echoLine " $line " ; done
641- }
642-
643- # Only filter if there's a filter file and we don't see a known interactive command.
644- # Obviously this is super ad hoc but I don't know how to improve on it. Testing whether
645- # stdin is a terminal is useless because most of my use cases for this filtering are
646- # exactly when I'm at a terminal, running sbt non-interactively.
647- shouldFilter () { [[ -f ~ /.sbtignore ]] && ! grep -E -q ' \b(shell|console|consoleProject)\b' <<< " ${residual_args[@]}" ; }
648-
649- # run sbt
650- if shouldFilter; then mainFiltered; else main; fi
604+ execRunner " $java_cmd " \
605+ " ${extra_jvm_opts[@]} " \
606+ " ${java_args[@]} " \
607+ -jar " $sbt_jar " \
608+ " ${sbt_commands[@]} " \
609+ " ${residual_args[@]} "
0 commit comments