add options for timings, traces, supershell, and color

`--supershell=*` will pass on to `-Dsbt.supershell=*`.
This commit is contained in:
Eugene Yokota 2019-04-05 11:30:59 -04:00
parent 56f09ef1ec
commit a47004e01e
2 changed files with 31 additions and 1 deletions

View File

@ -34,6 +34,24 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
()
}
test("sbt --color=false") {
val out = sbtProcess("compile --color=false -v").!!.linesIterator.toList
assert(out.contains[String]("-Dsbt.color=false"))
()
}
test("sbt --supershell=never") {
val out = sbtProcess("compile --supershell=never -v").!!.linesIterator.toList
assert(out.contains[String]("-Dsbt.supershell=never"))
()
}
test("sbt --timings") {
val out = sbtProcess("compile --timings -v").!!.linesIterator.toList
assert(out.contains[String]("-Dsbt.task.timings=true"))
()
}
test("sbt -mem 503") {
val out = sbtProcess("compile -mem 503 -v").!!.linesIterator.toList
assert(out.contains[String]("-Xmx503m"))

View File

@ -425,6 +425,12 @@ Usage: `basename "$0"` [options]
-v | --verbose this runner is chattier
-d | --debug set sbt log level to debug
--no-colors disable ANSI color codes
--color=auto|always|true|false|never
enable or disable ANSI color codes (sbt 1.3 and above)
--supershell=auto|always|true|false|never
enable or disable supershell (sbt 1.3 and above)
--traces generate Trace Event report on shutdown (sbt 1.3 and above)
--timings display task timings report on shutdown
--sbt-create start sbt even if current directory contains no sbt project
--sbt-dir <path> path to global settings/plugins directory (default: ~/.sbt)
--sbt-boot <path> path to shared boot directory (default: ~/.sbt/boot in 0.11 series)
@ -433,7 +439,7 @@ Usage: `basename "$0"` [options]
--no-share use all local caches; no sharing
--no-global uses global caches, but does not use global ~/.sbt directory.
--jvm-debug <port> Turn on JVM debugging, open at the given port.
--batch Disable interactive mode
--batch disable interactive mode
# sbt version (default: from project/build.properties if present, else latest release)
--sbt-version <version> use the specified version of sbt
@ -468,6 +474,12 @@ process_my_args () {
while [[ $# -gt 0 ]]; do
case "$1" in
-no-colors|--no-colors) addJava "-Dsbt.log.noformat=true" && shift ;;
-timings|--timings) addJava "-Dsbt.task.timings=true" && addJava "-Dsbt.task.timings.on.shutdown=true" && shift ;;
-traces|--traces) addJava "-Dsbt.traces=true" && shift ;;
--supershell=*) addJava "-Dsbt.supershell=${1:13}" && shift ;;
-supershell=*) addJava "-Dsbt.supershell=${1:12}" && shift ;;
--color=*) addJava "-Dsbt.color=${1:8}" && shift ;;
-color=*) addJava "-Dsbt.color=${1:7}" && shift ;;
-no-share|--no-share) addJava "$noshare_opts" && shift ;;
-no-global|--no-global) addJava "-Dsbt.global.base=$(pwd)/project/.sbtboot" && shift ;;
-sbt-boot|--sbt-boot) require_arg path "$1" "$2" && addJava "-Dsbt.boot.directory=$2" && shift 2 ;;