From 1bc60adbe75dc708f4e1495b2593c2d650698df0 Mon Sep 17 00:00:00 2001 From: Henri Cook Date: Mon, 25 May 2020 19:40:36 +0100 Subject: [PATCH] Tidy up -debug in SBT_OPTS for submission --- integration-test/src/test/scala/RunnerTest.scala | 7 +++++-- src/universal/bin/sbt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/integration-test/src/test/scala/RunnerTest.scala b/integration-test/src/test/scala/RunnerTest.scala index 7f0ec31d7..f94c26e76 100755 --- a/integration-test/src/test/scala/RunnerTest.scala +++ b/integration-test/src/test/scala/RunnerTest.scala @@ -138,10 +138,13 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions { } 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 - // 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 { - case (arg, index) if arg.endsWith("sbt-launch.jar") => index + case (arg, index) if sbtLaunchMatcher.findFirstIn(arg).nonEmpty => index } assert(locationOfSbtLaunchJarArg.nonEmpty) diff --git a/src/universal/bin/sbt b/src/universal/bin/sbt index 2408265b7..a3f9443e3 100755 --- a/src/universal/bin/sbt +++ b/src/universal/bin/sbt @@ -133,7 +133,7 @@ addJava () { java_args=( "${java_args[@]}" "$1" ) } addSbt () { - echoerr "[addSbt] arg = '$1'" + dlog "[addSbt] arg = '$1'" sbt_commands=( "${sbt_commands[@]}" "$1" ) } addResidual () {