From 29e203315bed363e0c6d077d5449246e1b1bd085 Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Mon, 31 Oct 2016 16:08:07 +0000 Subject: [PATCH 1/3] Cordapps now correctly resolve dependencies. --- .../groovy/com/r3corda/plugins/Cordformation.groovy | 5 ++++- .../src/main/groovy/com/r3corda/plugins/Node.groovy | 12 +++++------- 2 files changed, 9 insertions(+), 8 deletions(-) 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..2646c93e2c 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 @@ -174,9 +174,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 +224,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.getName()) } } } From 69dcd456602f26bab53bf64a606cc45cd5f81337 Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Wed, 2 Nov 2016 11:22:52 +0000 Subject: [PATCH 2/3] CorDapp dependencies must now be fully qualified maven dependency names. --- .../src/main/groovy/com/r3corda/plugins/Node.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 2646c93e2c..56534c3de3 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. */ @@ -226,7 +227,7 @@ class Node { */ private Collection getCordappList() { return project.configurations.cordapp.files { - cordapps.contains(it.getName()) + cordapps.contains("${it.group}:${it.name}:${it.version}") } } } From 18bd53711f0b5c6f39c6bbe570e452f8037c4908 Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Wed, 2 Nov 2016 11:23:31 +0000 Subject: [PATCH 3/3] Fixed spelling of CorDapp. --- .../src/main/groovy/com/r3corda/plugins/Node.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 56534c3de3..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,7 @@ class Node { */ protected List advertisedServices = [] /** - * Set the list of cordapps to install to the plugins directory. Each cordapp is a fully qualified Maven + * 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.