mirror of
https://github.com/corda/corda.git
synced 2025-04-12 21:53:17 +00:00
Cordapps now correctly resolve dependencies.
This commit is contained in:
parent
f26813c1ab
commit
29e203315b
@ -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<Project> {
|
||||
void apply(Project project) {
|
||||
|
||||
Configuration cordappConf = project.configurations.create("cordapp")
|
||||
cordappConf.transitive = false
|
||||
project.configurations.compile.extendsFrom cordappConf
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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<File> getCordappList() {
|
||||
return project.configurations.cordapp.files {
|
||||
cordapps.contains(it.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user