Tidy up -debug in SBT_OPTS for submission

This commit is contained in:
Henri Cook 2020-05-25 19:40:36 +01:00
parent 4872ddf3ef
commit 1bc60adbe7
2 changed files with 6 additions and 3 deletions

View File

@ -138,10 +138,13 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
} }
test("sbt with -debug in SBT_OPTS appears in sbt commands") { test("sbt with -debug in SBT_OPTS appears in sbt commands") {
if (isWindows) cancel("Test not supported on windows")
val out: List[String] = sbtProcessWithOpts("compile", "-v")("", "-debug").!!.linesIterator.toList val out: List[String] = sbtProcessWithOpts("compile", "-v")("", "-debug").!!.linesIterator.toList
// Debug argument must appear in the 'commands' section after sbt-launch.jar to work // Debug argument must appear in the 'commands' section (after the sbt-launch.jar argument) to work
val sbtLaunchMatcher = """^.+sbt-launch.jar["]{0,1}$""".r
val locationOfSbtLaunchJarArg = out.zipWithIndex.collectFirst { val locationOfSbtLaunchJarArg = out.zipWithIndex.collectFirst {
case (arg, index) if arg.endsWith("sbt-launch.jar") => index case (arg, index) if sbtLaunchMatcher.findFirstIn(arg).nonEmpty => index
} }
assert(locationOfSbtLaunchJarArg.nonEmpty) assert(locationOfSbtLaunchJarArg.nonEmpty)

View File

@ -133,7 +133,7 @@ addJava () {
java_args=( "${java_args[@]}" "$1" ) java_args=( "${java_args[@]}" "$1" )
} }
addSbt () { addSbt () {
echoerr "[addSbt] arg = '$1'" dlog "[addSbt] arg = '$1'"
sbt_commands=( "${sbt_commands[@]}" "$1" ) sbt_commands=( "${sbt_commands[@]}" "$1" )
} }
addResidual () { addResidual () {