Skip to content

Commit

Permalink
bat script: implement -jvm-debug (#1663)
Browse files Browse the repository at this point in the history
* bat script: implement -jvm-debug

* remove unnecessary cmd /c

* add quotes
  • Loading branch information
dwickern authored Jan 11, 2025
1 parent 379b670 commit 83bf2be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ rem Processes incoming arguments and places them in appropriate global variables
goto param_loop
)

if "!_TEST_PARAM!"=="-jvm-debug" (
set "_JAVA_PARAMS=!_JAVA_PARAMS! -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=%~1"
shift
goto param_loop
)

if "!_TEST_PARAM:~0,2!"=="-J" (
rem strip -J prefix
call set _TEST_PARAM=!_TEST_PARAM:~2!
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/windows/test-bat-template/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ TaskKey[Unit]("checkScript") := {
) = {
val pr = new StringBuilder()
val logger = ProcessLogger((o: String) => pr.append(o + "\n"), (e: String) => pr.append("error < " + e + "\n"))
val cmd = Seq("cmd", "/c", script.getAbsolutePath) ++ args
val cmd = script.getAbsolutePath +: args
val result = sys.process.Process(cmd, None, env.toSeq: _*) ! logger
if (result != expectedRC) {
pr.append("error code: " + result + "\n")
Expand All @@ -82,7 +82,7 @@ TaskKey[Unit]("checkScript") := {
fails.append(crlf2cr(pr.toString) + "\n")
fails.append("\n--detail-------------------------------\n")
pr.clear
sys.process.Process(Seq("cmd", "/c", detailScript.getAbsolutePath + " " + args), None, env.toSeq: _*) ! logger
sys.process.Process(detailScript.getAbsolutePath +: args, None, env.toSeq: _*) ! logger
fails.append(crlf2cr(pr.toString) + "\n")
}
if (debugOutFile.exists) {
Expand Down

0 comments on commit 83bf2be

Please sign in to comment.