CORDA-742 Added constant for cache directory.

This commit is contained in:
Mat Rizzo 2017-10-26 15:38:02 +01:00 committed by mat-rizzo-r3
parent 8021cdd364
commit a3c553d44a

View File

@ -183,7 +183,7 @@ open class Cordform : DefaultTask() {
// InheritIO causes hangs on windows due the gradle buffer also not being flushed.
// Must redirect to output or logger (node log is still written, this is just startup banner)
.redirectOutput(node.logFile().toFile())
.addEnvironment("CAPSULE_CACHE_DIR", "./cache")
.addEnvironment("CAPSULE_CACHE_DIR", capsuleCacheDir)
.start()
return Pair(node, process)
}
@ -191,7 +191,7 @@ open class Cordform : DefaultTask() {
private fun generateNodeInfoCommand(): List<String> = listOf(
"java",
"-Dcapsule.log=verbose",
"-Dcapsule.dir=./cache",
"-Dcapsule.dir=$capsuleCacheDir",
"-jar",
Node.nodeJarName,
"--just-generate-node-info"
@ -225,6 +225,7 @@ open class Cordform : DefaultTask() {
}
}
private const val capsuleCacheDir: String = "./cache"
private fun Node.fullPath(): Path = project.projectDir.toPath().resolve(this.nodeDir.toPath())
private fun Node.logDirectory(): Path = this.fullPath().resolve("logs")
private fun Node.makeLogDirectory() = Files.createDirectories(this.logDirectory())