Merged in clint-driver-debug-fix (pull request #308)

Fixed driver debug mode.
This commit is contained in:
Clinton Alexander 2016-08-31 11:31:02 +01:00
commit 5439e0980f

View File

@ -457,14 +457,16 @@ class DriverDSL(
val separator = System.getProperty("file.separator")
val classpath = System.getProperty("java.class.path")
val path = System.getProperty("java.home") + separator + "bin" + separator + "java"
val debugPortArg = if(debugPort != null)
listOf("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$debugPort")
else
emptyList()
val javaArgs = listOf(path) +
listOf("-Dname=$legalName", "-javaagent:$quasarJarPath",
"-cp", classpath, className) +
cliParams.toCliArguments() +
if (debugPort != null)
listOf("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$debugPort")
else
listOf()
listOf("-Dname=$legalName", "-javaagent:$quasarJarPath") + debugPortArg +
listOf("-cp", classpath, className) +
cliParams.toCliArguments()
val builder = ProcessBuilder(javaArgs)
builder.redirectError(Paths.get("error.$className.log").toFile())
builder.inheritIO()