Resources now correctly copied into nodes directory.

This commit is contained in:
Clinton Alexander 2016-10-07 10:41:31 +01:00
parent f56fea551d
commit 2f082d8cbe
5 changed files with 19 additions and 14 deletions

View File

@ -34,9 +34,8 @@ class Cordform extends DefaultTask {
}
protected void installRunScript() {
project.delete("${directory}/runnodes")
project.copy {
from "buildSrc/templates/runnodes"
from Cordformation.getPluginFile(project, "com/r3corda/plugins/runnodes")
filter { String line -> line.replace("JAR_NAME", Node.JAR_NAME) }
filter(org.apache.tools.ant.filters.FixCrLfFilter.class, eol: org.apache.tools.ant.filters.FixCrLfFilter.CrLf.newInstance("lf"))
into "${directory}/"

View File

@ -2,9 +2,16 @@ package com.r3corda.plugins
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.resources.TextResource
class Cordformation implements Plugin<Project> {
void apply(Project project) {
}
static def getPluginFile(Project project, String filePathInJar) {
return project.resources.text.fromArchiveEntry(project.buildscript.configurations.classpath.find {
it.name.contains('cordformation')
}, filePathInJar).asFile()
}
}

View File

@ -116,7 +116,7 @@ class Node {
private void installConfig() {
project.copy {
from ('./buildSrc/templates/nodetemplate.conf') {
from Cordformation.getPluginFile(project, 'com/r3corda/plugins/nodetemplate.conf')
filter { it
.replaceAll('@@name@@', name)
.replaceAll('@@dirName@@', dirName)
@ -128,7 +128,6 @@ class Node {
.replaceAll('@@artemisPort@@', artemisPort.toString())
.replaceAll('@@webPort@@', webPort.toString())
}
}
into nodeDir
rename 'nodetemplate.conf', 'node.conf'
}