diff --git a/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Cordformation.groovy b/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Cordformation.groovy index 5ebafd50e5..6c6c48f569 100644 --- a/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Cordformation.groovy +++ b/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Cordformation.groovy @@ -2,6 +2,7 @@ package com.r3corda.plugins import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration /** * The Cordformation plugin deploys nodes to a directory in a state ready to be used by a developer for experimentation, @@ -9,7 +10,9 @@ import org.gradle.api.Project */ class Cordformation implements Plugin { void apply(Project project) { - + Configuration cordappConf = project.configurations.create("cordapp") + cordappConf.transitive = false + project.configurations.compile.extendsFrom cordappConf } /** diff --git a/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Node.groovy b/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Node.groovy index 06bfd5ab98..dbea340072 100644 --- a/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Node.groovy +++ b/gradle-plugins/cordformation/src/main/groovy/com/r3corda/plugins/Node.groovy @@ -25,7 +25,8 @@ class Node { */ protected List advertisedServices = [] /** - * Set thThe list of cordapps to install to the plugins directory. + * Set the list of CorDapps to install to the plugins directory. Each cordapp is a fully qualified Maven + * dependency name, eg: com.example:product-name:0.1 * * @note Your app will be installed by default and does not need to be included here. */ @@ -174,9 +175,9 @@ class Node { */ private void installDependencies() { def cordaJar = verifyAndGetCordaJar() - def cordappList = getCordappList() + def cordappDeps = getCordappList() def depsDir = new File(nodeDir, "dependencies") - def appDeps = project.configurations.runtime.filter { it != cordaJar && !cordappList.contains(it) } + def appDeps = project.configurations.runtime.filter { it != cordaJar && !cordappDeps.contains(it) } project.copy { from appDeps into depsDir @@ -224,11 +225,9 @@ class Node { * * @return List of this node's cordapps. */ - private AbstractFileCollection getCordappList() { - def cordaJar = verifyAndGetCordaJar() - return project.configurations.runtime.filter { - def jarName = it.name.split('-').first() - return (it != cordaJar) && cordapps.contains(jarName) + private Collection getCordappList() { + return project.configurations.cordapp.files { + cordapps.contains("${it.group}:${it.name}:${it.version}") } } }