mirror of
https://github.com/corda/corda.git
synced 2025-04-07 19:34:41 +00:00
Using groovy templating.
This commit is contained in:
parent
32ae40cc90
commit
2bb8a5a7b6
@ -1,5 +1,6 @@
|
||||
package com.r3corda.plugins
|
||||
|
||||
import groovy.text.SimpleTemplateEngine
|
||||
import org.gradle.api.internal.file.AbstractFileCollection
|
||||
import org.gradle.api.Project
|
||||
|
||||
@ -201,16 +202,21 @@ class Node {
|
||||
private void installConfig() {
|
||||
project.copy {
|
||||
from Cordformation.getPluginFile(project, 'com/r3corda/plugins/nodetemplate.conf')
|
||||
filter { it
|
||||
.replaceAll('@@name@@', name)
|
||||
.replaceAll('@@dirName@@', dirName)
|
||||
.replaceAll('@@nearestCity@@', nearestCity)
|
||||
.replaceAll('@@isNotary@@', isNotary.toString())
|
||||
.replaceAll('@@isHttps@@', isHttps.toString())
|
||||
.replaceAll('@@advertisedServices@@', advertisedServices.join(","))
|
||||
.replaceAll('@@networkMapAddress@@', networkMapAddress)
|
||||
.replaceAll('@@artemisPort@@', artemisPort.toString())
|
||||
.replaceAll('@@webPort@@', webPort.toString())
|
||||
filter {
|
||||
def binding = [
|
||||
"name": name,
|
||||
"dirName": dirName,
|
||||
"nearestCity": nearestCity,
|
||||
"isNotary": isNotary,
|
||||
"isHttps": isHttps,
|
||||
"advertisedServices": advertisedServices,
|
||||
"networkMapAddress": networkMapAddress,
|
||||
"artemisPort": artemisPort.toString(),
|
||||
"webPort": webPort.toString()
|
||||
]
|
||||
|
||||
def engine = new SimpleTemplateEngine()
|
||||
engine.createTemplate(it).make(binding)
|
||||
}
|
||||
into nodeDir
|
||||
rename 'nodetemplate.conf', 'node.conf'
|
||||
|
@ -1,11 +1,11 @@
|
||||
basedir : "@@dirName@@"
|
||||
myLegalName : "@@name@@"
|
||||
nearestCity : "@@nearestCity@@"
|
||||
basedir : "$dirName"
|
||||
myLegalName : "$name"
|
||||
nearestCity : "$nearestCity"
|
||||
keyStorePassword : "cordacadevpass"
|
||||
trustStorePassword : "trustpass"
|
||||
artemisAddress : "localhost:@@artemisPort@@"
|
||||
webAddress : "localhost:@@webPort@@"
|
||||
hostNotaryServiceLocally: @@isNotary@@
|
||||
extraAdvertisedServiceIds: "@@advertisedServices@@"
|
||||
networkMapAddress : "@@networkMapAddress@@"
|
||||
useHTTPS : @@isHttps@@
|
||||
artemisAddress : "localhost:$artemisPort"
|
||||
webAddress : "localhost:$webPort"
|
||||
hostNotaryServiceLocally: $isNotary
|
||||
extraAdvertisedServiceIds: "$advertisedServices"
|
||||
networkMapAddress : "$networkMapAddress"
|
||||
useHTTPS : $isHttps
|
||||
|
Loading…
x
Reference in New Issue
Block a user