From a4a48d06f340ba8cd815bb3041b06c57162ea315 Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Fri, 4 Nov 2016 17:15:06 +0000 Subject: [PATCH 1/3] Corda JAR now contains required files. --- build.gradle | 9 ++++++++- buildSrc/src/main/groovy/QuasarPlugin.groovy | 15 +++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 233803e534..aaafea1715 100644 --- a/build.gradle +++ b/build.gradle @@ -33,6 +33,7 @@ apply plugin: 'kotlin' apply plugin: 'project-report' apply plugin: 'com.github.ben-manes.versions' apply plugin: 'maven-publish' +apply plugin: QuasarPlugin allprojects { apply plugin: 'java' @@ -51,9 +52,15 @@ allprojects { } repositories { + mavenCentral() jcenter() } +dependencies { + // Required for Quasar. TODO: Remove this dependency. + compile "com.google.guava:guava:19.0" +} + task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { dependsOn = subprojects.test additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) @@ -79,7 +86,7 @@ tasks.withType(Test) { reports.html.destination = file("${reporting.baseDir}/${name}") } -task buildCordaJAR(type: FatCapsule, dependsOn: ['build', 'buildCertSigningRequestUtilityJAR']) { +task buildCordaJAR(type: FatCapsule, dependsOn: ['quasarScan', 'buildCertSigningRequestUtilityJAR']) { applicationClass 'com.r3corda.node.MainKt' archiveName 'corda.jar' applicationSource = files(project.tasks.findByName('jar'), 'node/build/classes/main/CordaCaplet.class') diff --git a/buildSrc/src/main/groovy/QuasarPlugin.groovy b/buildSrc/src/main/groovy/QuasarPlugin.groovy index 1bc768acfa..06d3ca7e99 100644 --- a/buildSrc/src/main/groovy/QuasarPlugin.groovy +++ b/buildSrc/src/main/groovy/QuasarPlugin.groovy @@ -1,6 +1,7 @@ import org.gradle.api.* import org.gradle.api.tasks.testing.Test import org.gradle.api.tasks.JavaExec +import java.nio.file.Files /** * QuasarPlugin creates a "quasar" configuration, adds quasar as a dependency and creates a "quasarScan" task that scans @@ -43,13 +44,15 @@ class QuasarPlugin implements Plugin { ant.taskdef(name:'scanSuspendables', classname:'co.paralleluniverse.fibers.instrument.SuspendablesScanner', classpath: "${project.sourceSets.main.output.classesDir}:${project.sourceSets.main.output.resourcesDir}:${project.configurations.runtime.asPath}") project.delete "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers" - ant.scanSuspendables( - auto:false, - suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", - supersFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") { - fileset(dir: project.sourceSets.main.output.classesDir) - } + if(Files.isRegularFile(project.sourceSets.main.output.classesDir)) { + ant.scanSuspendables( + auto: false, + suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", + supersFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") { + fileset(dir: project.sourceSets.main.output.classesDir) + } + } } project.jar.dependsOn project.quasarScan From 3ab56fa2239a851c477c46e4fd5a2a93c9e1de33 Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Fri, 4 Nov 2016 17:53:37 +0000 Subject: [PATCH 2/3] Added back gradle config needed by quasar and capsule. --- build.gradle | 8 +++++++- buildSrc/src/main/groovy/QuasarPlugin.groovy | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index aaafea1715..fc737f327d 100644 --- a/build.gradle +++ b/build.gradle @@ -54,10 +54,14 @@ allprojects { repositories { mavenCentral() jcenter() + maven { + url 'https://dl.bintray.com/kotlin/exposed' + } } +// Required for building out the fat JAR. dependencies { - // Required for Quasar. TODO: Remove this dependency. + compile project(':node') compile "com.google.guava:guava:19.0" } @@ -146,6 +150,8 @@ task installTemplateNodes(dependsOn: 'buildCordaJAR') << { // TODO: Verify this works for gradle plugins. task(install, dependsOn: 'publishToMavenLocal') +quasarScan.dependsOn('classes', ':node:classes', ':core:classes', ':finance:classes') + publishing { publications { corda(MavenPublication) { diff --git a/buildSrc/src/main/groovy/QuasarPlugin.groovy b/buildSrc/src/main/groovy/QuasarPlugin.groovy index 06d3ca7e99..f13b7442ae 100644 --- a/buildSrc/src/main/groovy/QuasarPlugin.groovy +++ b/buildSrc/src/main/groovy/QuasarPlugin.groovy @@ -45,7 +45,7 @@ class QuasarPlugin implements Plugin { classpath: "${project.sourceSets.main.output.classesDir}:${project.sourceSets.main.output.resourcesDir}:${project.configurations.runtime.asPath}") project.delete "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers" - if(Files.isRegularFile(project.sourceSets.main.output.classesDir)) { + if(project.sourceSets.main.output.classesDir.exists()) { ant.scanSuspendables( auto: false, suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", From c2a5589b20e90e5f4b4800c037e4549210e68f5e Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Mon, 7 Nov 2016 14:35:19 +0000 Subject: [PATCH 3/3] Added TODO about moving fat JAR code to node. --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index fc737f327d..142bb23fa6 100644 --- a/build.gradle +++ b/build.gradle @@ -90,6 +90,7 @@ tasks.withType(Test) { reports.html.destination = file("${reporting.baseDir}/${name}") } +// TODO: Move fat JAR building into node subproject. task buildCordaJAR(type: FatCapsule, dependsOn: ['quasarScan', 'buildCertSigningRequestUtilityJAR']) { applicationClass 'com.r3corda.node.MainKt' archiveName 'corda.jar'