From 3f5017f26bbda55c8f8cd0d33b08b6def293af2b Mon Sep 17 00:00:00 2001 From: Clinton Date: Thu, 27 Jul 2017 17:53:51 +0100 Subject: [PATCH] Renamed corda configuration in gradle to cordaCompile to be more explicit. (#1131) * Renamed corda configuration in gradle to cordaCompile to be more explicit. * Bumped version number of gradle plugins. --- build.gradle | 21 ++++++++++--------- constants.properties | 2 +- docs/source/cordapp-build-systems.rst | 18 ++++++++-------- .../net/corda/plugins/Cordformation.groovy | 4 ++-- samples/attachment-demo/build.gradle | 10 ++++----- samples/bank-of-corda-demo/build.gradle | 16 +++++++------- samples/irs-demo/build.gradle | 10 ++++----- samples/notary-demo/build.gradle | 14 ++++++------- samples/simm-valuation-demo/build.gradle | 10 ++++----- samples/trader-demo/build.gradle | 8 +++---- 10 files changed, 57 insertions(+), 56 deletions(-) diff --git a/build.gradle b/build.gradle index 4904203fc2..aff8bffd9a 100644 --- a/build.gradle +++ b/build.gradle @@ -168,22 +168,23 @@ repositories { } } +// TODO: Corda root project currently produces a dummy cordapp when it shouldn't. // Required for building out the fat JAR. dependencies { - compile project(':node') + cordaCompile project(':node') compile "com.google.guava:guava:$guava_version" - // Set to compile to ensure it exists now deploy nodes no longer relies on build - compile project(path: ":node:capsule", configuration: 'runtimeArtifacts') - compile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + // Set to corda compile to ensure it exists now deploy nodes no longer relies on build + cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') // For the buildCordappDependenciesJar task - runtime project(':client:jfx') - runtime project(':client:mock') - runtime project(':client:rpc') - runtime project(':core') - runtime project(':finance') - runtime project(':webserver') + cordaRuntime project(':client:jfx') + cordaRuntime project(':client:mock') + cordaRuntime project(':client:rpc') + cordaRuntime project(':core') + cordaRuntime project(':finance') + cordaRuntime project(':webserver') testCompile project(':test-utils') } diff --git a/constants.properties b/constants.properties index 7bbe2d19ee..4567dcffbb 100644 --- a/constants.properties +++ b/constants.properties @@ -1,4 +1,4 @@ -gradlePluginsVersion=0.13.4 +gradlePluginsVersion=0.13.6 kotlinVersion=1.1.1 guavaVersion=21.0 bouncycastleVersion=1.57 diff --git a/docs/source/cordapp-build-systems.rst b/docs/source/cordapp-build-systems.rst index 1a72d65542..e67e662346 100644 --- a/docs/source/cordapp-build-systems.rst +++ b/docs/source/cordapp-build-systems.rst @@ -28,15 +28,15 @@ Building against Corda To build against Corda you must do the following to your ``build.gradle``; * Add the ``net.corda:corda:`` JAR as a ``cordaRuntime`` dependency. -* Add each compile dependency (eg ``corda-core``) as a ``corda`` dependency. +* Add each compile dependency (eg ``corda-core``) as a ``cordaCompile`` dependency. To make use of the Corda test facilities you must; * Add ``net.corda:corda-test-utils:`` as a ``testCompile`` dependency (eg; a default Java/Kotlin compile task). -.. warning:: Never include ``corda-test-utils`` as a ``compile`` or ``corda`` dependency. +.. warning:: Never include ``corda-test-utils`` as a ``compile`` or ``cordaCompile`` dependency. -These configurations work by the ``cordformation`` plugin adding ``corda`` as a new configuration that ``compile`` +These configurations work by the ``cordformation`` plugin adding ``cordaCompile`` as a new configuration that ``compile`` extends from, and ``cordaRuntime`` which ``runtime`` extends from. Choosing your Corda version @@ -93,12 +93,12 @@ is already correctly configured and this is for reference only; dependencies { // Corda integration dependencies - corda "net.corda:corda-core:$corda_release_version" - corda "net.corda:corda-finance:$corda_release_version" - corda "net.corda:corda-jackson:$corda_release_version" - corda "net.corda:corda-rpc:$corda_release_version" - corda "net.corda:corda-node-api:$corda_release_version" - corda "net.corda:corda-webserver-impl:$corda_release_version" + cordaCompile "net.corda:corda-core:$corda_release_version" + cordaCompile "net.corda:corda-finance:$corda_release_version" + cordaCompile "net.corda:corda-jackson:$corda_release_version" + cordaCompile "net.corda:corda-rpc:$corda_release_version" + cordaCompile "net.corda:corda-node-api:$corda_release_version" + cordaCompile "net.corda:corda-webserver-impl:$corda_release_version" cordaRuntime "net.corda:corda:$corda_release_version" cordaRuntime "net.corda:corda-webserver:$corda_release_version" testCompile "net.corda:corda-test-utils:$corda_release_version" diff --git a/gradle-plugins/cordformation/src/main/groovy/net/corda/plugins/Cordformation.groovy b/gradle-plugins/cordformation/src/main/groovy/net/corda/plugins/Cordformation.groovy index 5d219aa486..638d532e03 100644 --- a/gradle-plugins/cordformation/src/main/groovy/net/corda/plugins/Cordformation.groovy +++ b/gradle-plugins/cordformation/src/main/groovy/net/corda/plugins/Cordformation.groovy @@ -11,7 +11,7 @@ import org.gradle.api.artifacts.Configuration class Cordformation implements Plugin { void apply(Project project) { createCompileConfiguration("cordapp", project) - createCompileConfiguration("corda", project) + createCompileConfiguration("cordaCompile", project) Configuration configuration = project.configurations.create("cordaRuntime") configuration.transitive = false @@ -65,7 +65,7 @@ class Cordformation implements Plugin { project.with { // The direct dependencies of this project - def excludeDeps = configurations.cordapp.allDependencies + configurations.corda.allDependencies + configurations.cordaRuntime.allDependencies + def excludeDeps = configurations.cordapp.allDependencies + configurations.cordaCompile.allDependencies + configurations.cordaRuntime.allDependencies def directDeps = configurations.runtime.allDependencies - excludeDeps // We want to filter out anything Corda related or provided by Corda, like kotlin-stdlib and quasar def filteredDeps = directDeps.findAll { excludes.collect { exclude -> (exclude.group == it.group) && (exclude.name == it.name) }.findAll { it }.isEmpty() } diff --git a/samples/attachment-demo/build.gradle b/samples/attachment-demo/build.gradle index b2057f553f..ac78ca52c8 100644 --- a/samples/attachment-demo/build.gradle +++ b/samples/attachment-demo/build.gradle @@ -26,11 +26,11 @@ dependencies { testCompile "junit:junit:$junit_version" // Corda integration dependencies - corda project(path: ":node:capsule", configuration: 'runtimeArtifacts') - corda project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') - corda project(':core') - corda project(':webserver') - corda project(':test-utils') + cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':webserver') + cordaCompile project(':test-utils') } task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { diff --git a/samples/bank-of-corda-demo/build.gradle b/samples/bank-of-corda-demo/build.gradle index a636257915..89fb601a0c 100644 --- a/samples/bank-of-corda-demo/build.gradle +++ b/samples/bank-of-corda-demo/build.gradle @@ -26,14 +26,14 @@ dependencies { testCompile "junit:junit:$junit_version" // Corda integration dependencies - corda project(path: ":node:capsule", configuration: 'runtimeArtifacts') - corda project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') - corda project(':core') - corda project(':client:jfx') - corda project(':client:rpc') - corda project(':finance') - corda project(':webserver') - corda project(':test-utils') + cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':client:jfx') + cordaCompile project(':client:rpc') + cordaCompile project(':finance') + cordaCompile project(':webserver') + cordaCompile project(':test-utils') // Javax is required for webapis compile "org.glassfish.jersey.core:jersey-server:${jersey_version}" diff --git a/samples/irs-demo/build.gradle b/samples/irs-demo/build.gradle index 7ad7a5b69a..05866ff070 100644 --- a/samples/irs-demo/build.gradle +++ b/samples/irs-demo/build.gradle @@ -28,11 +28,11 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" // Corda integration dependencies - corda project(path: ":node:capsule", configuration: 'runtimeArtifacts') - corda project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') - corda project(':core') - corda project(':finance') - corda project(':webserver') + cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':finance') + cordaCompile project(':webserver') // Javax is required for webapis compile "org.glassfish.jersey.core:jersey-server:${jersey_version}" diff --git a/samples/notary-demo/build.gradle b/samples/notary-demo/build.gradle index 53ca1dbcf3..d6b9266937 100644 --- a/samples/notary-demo/build.gradle +++ b/samples/notary-demo/build.gradle @@ -18,13 +18,13 @@ dependencies { testCompile "junit:junit:$junit_version" // Corda integration dependencies - corda project(path: ":node:capsule", configuration: 'runtimeArtifacts') - corda project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') - corda project(':core') - corda project(':client:jfx') - corda project(':client:rpc') - corda project(':test-utils') - corda project(':cordform-common') + cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':client:jfx') + cordaCompile project(':client:rpc') + cordaCompile project(':test-utils') + cordaCompile project(':cordform-common') } idea { diff --git a/samples/simm-valuation-demo/build.gradle b/samples/simm-valuation-demo/build.gradle index 799185948d..b3682bbeba 100644 --- a/samples/simm-valuation-demo/build.gradle +++ b/samples/simm-valuation-demo/build.gradle @@ -29,11 +29,11 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" // Corda integration dependencies - corda project(path: ":node:capsule", configuration: 'runtimeArtifacts') - corda project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') - corda project(':core') - corda project(':webserver') - corda project(':finance') + cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':webserver') + cordaCompile project(':finance') // Cordapp dependencies // Specify your cordapp's dependencies below, including dependent cordapps diff --git a/samples/trader-demo/build.gradle b/samples/trader-demo/build.gradle index 20fde95db3..c3cd3b5060 100644 --- a/samples/trader-demo/build.gradle +++ b/samples/trader-demo/build.gradle @@ -25,10 +25,10 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" // Corda integration dependencies - corda project(path: ":node:capsule", configuration: 'runtimeArtifacts') - corda project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') - corda project(':core') - corda project(':finance') + cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts') + cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts') + cordaCompile project(':core') + cordaCompile project(':finance') // Corda Plugins: dependent flows and services cordapp project(':samples:bank-of-corda-demo')