CORDA-2876: Ensure NodeConfig does not have devModeOptions outside of devMode. (#5676)

This commit is contained in:
Chris Rankin 2019-11-05 16:59:40 +00:00 committed by Matthew Nesbit
parent f226ddc4f2
commit 02ed8e91b3

View File

@ -736,10 +736,14 @@ class DriverDSLImpl(
* These will all be ignored unless devMode is also true. * These will all be ignored unless devMode is also true.
*/ */
private fun Config.withDJVMConfig(bootstrapSource: Path?, cordaSource: List<Path>): Config { private fun Config.withDJVMConfig(bootstrapSource: Path?, cordaSource: List<Path>): Config {
return if (hasPath("devMode") && getBoolean("devMode")) { return if (hasPath("devMode")) {
withOptionalValue("devModeOptions.djvm.bootstrapSource", bootstrapSource) { path -> if (getBoolean("devMode")) {
valueFor(path.toString()) withOptionalValue("devModeOptions.djvm.bootstrapSource", bootstrapSource) { path ->
}.withValue("devModeOptions.djvm.cordaSource", valueFor(cordaSource.map(Path::toString))) valueFor(path.toString())
}.withValue("devModeOptions.djvm.cordaSource", valueFor(cordaSource.map(Path::toString)))
} else {
withoutPath("devModeOptions")
}
} else { } else {
this this
} }