Many fixes to get gradle plugins and other projects working post-merge.

This commit is contained in:
Clinton Alexander 2016-11-17 17:08:57 +00:00
parent 34d1e1583e
commit 2b96f7e79e
14 changed files with 51 additions and 14 deletions

View File

@ -103,7 +103,7 @@ tasks.withType(Test) {
// TODO: Move fat JAR building into node subproject.
task buildCordaJAR(type: FatCapsule, dependsOn: ['quasarScan', 'buildCertSigningRequestUtilityJAR']) {
applicationClass 'net.corda.node.MainKt'
archiveName 'corda.jar'
archiveName "corda-${corda_version}.jar"
applicationSource = files(project.tasks.findByName('jar'), 'node/build/classes/main/CordaCaplet.class')
capsuleManifest {
@ -125,7 +125,7 @@ task buildCertSigningRequestUtilityJAR(type: FatCapsule, dependsOn: project.jar)
}
// TODO: Use the Cordformation plugin.
task installTemplateNodes(dependsOn: 'buildCordaJAR') << {
task deployNodes(dependsOn: 'buildCordaJAR') << {
copy {
from buildCordaJAR.outputs.getFiles()
from 'config/dev/nameservernode.conf'

View File

@ -8,7 +8,7 @@ The Corda all-in-one ``corda.jar`` file is generated by the ``gradle buildCordaJ
This behaviour can be overidden using the ``--config-file`` command line option to target configuration files with different names, or different file location (relative paths are relative to the current working directory).
Also, the ``--base-directory`` command line option alters the Corda node workspace location and if specified a ``node.conf`` configuration file is then expected in the root of the workspace.
The configuration file templates used for the ``gradle installTemplateNodes`` task are to be found in the ``/config/dev`` folder. Also note that there is a basic set of defaults loaded from
The configuration file templates used for the ``gradle deployNodes`` task are to be found in the ``/config/dev`` folder. Also note that there is a basic set of defaults loaded from
the built in resource file ``/node/src/main/resources/reference.conf`` of the ``:node`` gradle module. All properties in this can be overidden in the file configuration
and for rarely changed properties this defaulting allows the property to be excluded from the configuration file.

View File

@ -9,3 +9,11 @@ the rest of the Corda libraries.
Some of the plugins here are duplicated with the ones in buildSrc. While the duplication is unwanted any
currently known solution (such as publishing from buildSrc or setting up a separate project/repo) would
introduce a two step build which is less convenient.
Installing
----------
If you need to bootstrap the corda repository you can install these plugins with
gradle -u install

View File

@ -0,0 +1,27 @@
// This script exists just to allow bootstrapping the gradle plugins if maven central or jcenter are unavailable
// or if you are developing these plugins. See the readme for more information.
buildscript {
// Our version: bump this on release.
ext.corda_version = "0.6-SNAPSHOT"
ext.corda_published_version = "0.5" // Depend on our existing published publishing plugin.
repositories {
jcenter()
}
dependencies {
classpath "net.corda.plugins:publish-utils:$corda_published_version"
}
}
apply plugin: 'maven-publish'
allprojects {
group 'net.corda'
version "$corda_version"
}
// Aliasing the publishToMavenLocal for simplicity.
task(install, dependsOn: 'publishToMavenLocal')

View File

@ -1,5 +1,5 @@
apply plugin: 'groovy'
apply plugin: DefaultPublishTasks
apply plugin: 'net.corda.plugins.publish-utils'
dependencies {
compile gradleApi()

View File

@ -209,7 +209,7 @@ class Node {
* @return A file representing the Corda JAR.
*/
private File verifyAndGetCordaJar() {
def maybeCordaJAR = project.configurations.runtime.filter { it.toString().contains("corda-${project.rootProject.corda_version}.jar")}
def maybeCordaJAR = project.configurations.runtime.filter { it.toString().contains("corda-${project.corda_version}.jar")}
if(maybeCordaJAR.size() == 0) {
throw new RuntimeException("No Corda Capsule JAR found. Have you deployed the Corda project to Maven? Looked for \"corda-${project.corda_version}.jar\"")
} else {

View File

@ -0,0 +1 @@
version 0.6 s

View File

@ -1,5 +1,5 @@
apply plugin: 'groovy'
apply plugin: DefaultPublishTasks
apply plugin: 'net.corda.plugins.publish-utils' // TODO: Remove when bintray publishing code is in master
dependencies {
compile gradleApi()

View File

@ -1,5 +1,5 @@
apply plugin: 'groovy'
apply plugin: DefaultPublishTasks
apply plugin: 'net.corda.plugins.publish-utils'
dependencies {
compile gradleApi()

View File

@ -0,0 +1,4 @@
rootProject.name = 'corda-gradle-plugins'
include 'quasar-utils'
include 'publish-utils'
include 'cordformation'

View File

@ -25,6 +25,10 @@ repositories {
maven {
url 'https://dl.bintray.com/kotlin/exposed'
}
// A hack to allow the samples to use the locally built corda.jar. Do not copy in other cordapps.
flatDir {
dirs rootProject.buildDir.toString() + '/libs'
}
}
dependencies {

View File

@ -35,7 +35,6 @@ repositories {
}
}
sourceSets {
main {
resources {

View File

@ -75,9 +75,6 @@ dependencies {
compile("org.graphstream:gs-ui:1.3") {
exclude group: "bouncycastle"
}
// Cordapp dependencies
// Specify your cordapp's dependencies below, including dependent cordapps
}
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: [':install']) {

View File

@ -8,9 +8,6 @@ include 'experimental'
include 'test-utils'
include 'tools:explorer'
include 'tools:loadtest'
include 'gradle-plugins:quasar-utils'
include 'gradle-plugins:publish-utils'
include 'gradle-plugins:cordformation'
include 'docs/source/example-code' // Note that we are deliberately choosing to use '/' here. With ':' gradle would treat the directories as actual projects.
include 'samples:attachment-demo'
include 'samples:trader-demo'