mirror of
https://github.com/corda/corda.git
synced 2025-01-20 19:49:25 +00:00
Merge branch 'master' into colljos-vault-code-clean-up-refactor
This commit is contained in:
commit
3410671694
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,8 @@ class Node {
|
||||
*/
|
||||
protected List<String> 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<File> getCordappList() {
|
||||
return project.configurations.cordapp.files {
|
||||
cordapps.contains("${it.group}:${it.name}:${it.version}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user