Skip to content

Commit

Permalink
Renamed corda configuration in gradle to cordaCompile to be more expl…
Browse files Browse the repository at this point in the history
…icit. (corda#1131)

* Renamed corda configuration in gradle to cordaCompile to be more explicit.

* Bumped version number of gradle plugins.
  • Loading branch information
Clintonio authored Jul 27, 2017
1 parent 197e627 commit 9eceb26
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ repositories {
// TODO: Corda root project currently produces a dummy cordapp when it shouldn't.
// Required for building out the fat JAR.
dependencies {
corda project(':node')
cordaCompile project(':node')
compile "com.google.guava:guava:$guava_version"

// Set to corda compile to ensure it exists now deploy nodes no longer relies on build
corda project(path: ":node:capsule", configuration: 'runtimeArtifacts')
corda project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts')
cordaCompile project(path: ":node:capsule", configuration: 'runtimeArtifacts')
cordaCompile project(path: ":webserver:webcapsule", configuration: 'runtimeArtifacts')

// For the buildCordappDependenciesJar task
cordaRuntime project(':client:jfx')
Expand Down
2 changes: 1 addition & 1 deletion constants.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gradlePluginsVersion=0.13.5
gradlePluginsVersion=0.13.6
kotlinVersion=1.1.1
guavaVersion=21.0
bouncycastleVersion=1.57
Expand Down
18 changes: 9 additions & 9 deletions docs/source/cordapp-build-systems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:<version>`` 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:<version>`` 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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.gradle.api.artifacts.Configuration
class Cordformation implements Plugin<Project> {
void apply(Project project) {
createCompileConfiguration("cordapp", project)
createCompileConfiguration("corda", project)
createCompileConfiguration("cordaCompile", project)

Configuration configuration = project.configurations.create("cordaRuntime")
configuration.transitive = false
Expand Down Expand Up @@ -65,7 +65,7 @@ class Cordformation implements Plugin<Project> {

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() }
Expand Down
10 changes: 5 additions & 5 deletions samples/attachment-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down
16 changes: 8 additions & 8 deletions samples/bank-of-corda-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
10 changes: 5 additions & 5 deletions samples/irs-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
14 changes: 7 additions & 7 deletions samples/notary-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions samples/simm-valuation-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions samples/trader-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 9eceb26

Please sign in to comment.