Merged in clint-fatjarfix (pull request #451)

Added back gradle config needed by quasar and capsule.
This commit is contained in:
Clinton Alexander 2016-11-07 14:54:56 +00:00
commit aa7e99f1b6
2 changed files with 24 additions and 7 deletions

View File

@ -33,6 +33,7 @@ apply plugin: 'kotlin'
apply plugin: 'project-report' apply plugin: 'project-report'
apply plugin: 'com.github.ben-manes.versions' apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: QuasarPlugin
allprojects { allprojects {
apply plugin: 'java' apply plugin: 'java'
@ -51,7 +52,17 @@ allprojects {
} }
repositories { repositories {
mavenCentral()
jcenter() jcenter()
maven {
url 'https://dl.bintray.com/kotlin/exposed'
}
}
// Required for building out the fat JAR.
dependencies {
compile project(':node')
compile "com.google.guava:guava:19.0"
} }
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
@ -79,7 +90,8 @@ tasks.withType(Test) {
reports.html.destination = file("${reporting.baseDir}/${name}") reports.html.destination = file("${reporting.baseDir}/${name}")
} }
task buildCordaJAR(type: FatCapsule, dependsOn: ['build', 'buildCertSigningRequestUtilityJAR']) { // TODO: Move fat JAR building into node subproject.
task buildCordaJAR(type: FatCapsule, dependsOn: ['quasarScan', 'buildCertSigningRequestUtilityJAR']) {
applicationClass 'com.r3corda.node.MainKt' applicationClass 'com.r3corda.node.MainKt'
archiveName 'corda.jar' archiveName 'corda.jar'
applicationSource = files(project.tasks.findByName('jar'), 'node/build/classes/main/CordaCaplet.class') applicationSource = files(project.tasks.findByName('jar'), 'node/build/classes/main/CordaCaplet.class')
@ -139,6 +151,8 @@ task installTemplateNodes(dependsOn: 'buildCordaJAR') << {
// TODO: Verify this works for gradle plugins. // TODO: Verify this works for gradle plugins.
task(install, dependsOn: 'publishToMavenLocal') task(install, dependsOn: 'publishToMavenLocal')
quasarScan.dependsOn('classes', ':node:classes', ':core:classes', ':finance:classes')
publishing { publishing {
publications { publications {
corda(MavenPublication) { corda(MavenPublication) {

View File

@ -1,6 +1,7 @@
import org.gradle.api.* import org.gradle.api.*
import org.gradle.api.tasks.testing.Test import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.JavaExec 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 * 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<Project> {
ant.taskdef(name:'scanSuspendables', classname:'co.paralleluniverse.fibers.instrument.SuspendablesScanner', 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}") 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" project.delete "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers"
if(project.sourceSets.main.output.classesDir.exists()) {
ant.scanSuspendables( ant.scanSuspendables(
auto: false, auto: false,
suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables",
supersFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") { supersFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") {
fileset(dir: project.sourceSets.main.output.classesDir) fileset(dir: project.sourceSets.main.output.classesDir)
} }
}
} }
project.jar.dependsOn project.quasarScan project.jar.dependsOn project.quasarScan