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