From 4851d9ca6a5e5df331e9895feb45aece93ac83b2 Mon Sep 17 00:00:00 2001 From: Joel Dudley Date: Mon, 29 Jan 2018 12:42:31 +0000 Subject: [PATCH] Documents rationale for using cordapp, cordaRuntime and cordaCompile Gradle configs. --- docs/source/cordapp-build-systems.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/source/cordapp-build-systems.rst b/docs/source/cordapp-build-systems.rst index 5cba71b9af..3900680d81 100644 --- a/docs/source/cordapp-build-systems.rst +++ b/docs/source/cordapp-build-systems.rst @@ -53,6 +53,10 @@ The ``cordformation`` plugin adds two new gradle configurations: * ``cordaCompile``, which extends ``compile`` * ``cordaRuntime``, which extends ``runtime`` +``cordaCompile`` and ``cordaRuntime`` indicate dependencies that should not be included in the CorDapp JAR. These +configurations should be used for any Corda dependency (e.g. ``corda-core``, ``corda-node``) in order to prevent a +dependency from being included twice (once in the CorDapp JAR and once in the Corda JARs). + To build against Corda, you must add the following to your ``build.gradle`` file: * ``net.corda:corda:$corda_release_version`` as a ``cordaRuntime`` dependency @@ -75,6 +79,15 @@ ways to add another CorDapp as a dependency in your CorDapp's ``build.gradle`` f * ``cordapp project(":another-cordapp")`` (use this if the other CorDapp is defined in a module in the same project) * ``cordapp "net.corda:another-cordapp:1.0"`` (use this otherwise) +The ``cordapp`` gradle configuration serves two purposes: + +* When using the ``cordformation`` Gradle plugin, the ``cordapp`` configuration indicates that this JAR should be + included on your node as a CorDapp +* When using the ``cordapp`` Gradle plugin, the ``cordapp`` configuration prevents the dependency from being included + in the CorDapp JAR + +Note that the ``cordformation`` and ``cordapp`` Gradle plugins can be used together. + Other dependencies ^^^^^^^^^^^^^^^^^^ If your CorDapps have any additional external dependencies, they can be specified like normal Kotlin/Java dependencies @@ -145,4 +158,4 @@ Installing the CorDapp JAR At runtime, nodes will load any CorDapps present in their ``cordapps`` folder. Therefore in order to install a CorDapp on a node, the CorDapp JAR must be added to the ``/cordapps/`` folder, where ``node_dir`` is the folder in which -the node's JAR and configuration files are stored. \ No newline at end of file +the node's JAR and configuration files are stored.