Created
February 27, 2018 10:48
-
-
Save george-hawkins/0d5a33df099f990e2ba1b7dc06a3f47b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/gradle-plugins/cordformation/src/noderunner/kotlin/net/corda/plugins/NodeRunner.kt b/gradle-plugins/cordformation/src/noderunner/kotlin/net/corda/plugins/NodeRunner.kt | |
index 83462c2..0f3d67b 100644 | |
--- a/gradle-plugins/cordformation/src/noderunner/kotlin/net/corda/plugins/NodeRunner.kt | |
+++ b/gradle-plugins/cordformation/src/noderunner/kotlin/net/corda/plugins/NodeRunner.kt | |
@@ -50,14 +50,20 @@ private abstract class JarType(private val jarName: String) { | |
} | |
val debugPort = debugPortAlloc.next() | |
println("Starting $jarName in $dir on debug port $debugPort") | |
- val process = (if (headless) ::HeadlessJavaCommand else ::TerminalWindowJavaCommand)(jarName, dir, debugPort, javaArgs, jvmArgs).start() | |
+ val appArgs = javaArgs + (if (headless) headlessArgs else headedArgs) | |
+ val process = (if (headless) ::HeadlessJavaCommand else ::TerminalWindowJavaCommand)(jarName, dir, debugPort, appArgs, jvmArgs).start() | |
if (os == OS.MACOS) Thread.sleep(1000) | |
return process | |
} | |
+ | |
+ protected open val headlessArgs = listOf<String>() | |
+ protected open val headedArgs = listOf<String>() | |
} | |
private object NodeJarType : JarType("corda.jar") { | |
override fun acceptNodeConf(nodeConf: File) = true | |
+ | |
+ override val headlessArgs = listOf("--no-local-shell") | |
} | |
private object WebJarType : JarType("corda-webserver.jar") { | |
@@ -90,7 +96,7 @@ private abstract class JavaCommand( | |
} | |
private class HeadlessJavaCommand(jarName: String, dir: File, debugPort: Int?, args: List<String>, jvmArgs: List<String>) | |
- : JavaCommand(jarName, dir, debugPort, dir.name, { add("--no-local-shell") }, args, jvmArgs) { | |
+ : JavaCommand(jarName, dir, debugPort, dir.name, {}, args, jvmArgs) { | |
override fun processBuilder() = ProcessBuilder(command).redirectError(File("error.$nodeName.log")).inheritIO() | |
override fun getJavaPath() = File(File(System.getProperty("java.home"), "bin"), "java").path | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment