corda/node-schemas/build.gradle
Chris Rankin 98266da41c Refactor CordaRPCClient into new :client:rpc Gradle module. (#405)
* CORDA-305: Refactor CordaRPCClient into :client:rpc module

* CORDA-305: Remove the Kotlin test framework from the artifacts.

* CORDA-305: Migrate serialisation whitelist into node-api module.

* CORDA-305: Clean up unused RPC observables.

* CORDA-305: Add :client:rpc module to documentation tasks.

* CORDA-305: Include :finance into :client:rpc for its serialisable classes.

* CORDA-305: Move test classes into the correct directory.

* CORDA-305: Migrate :finance dependency from :client:rpc into DemoBench.

* CORDA-305: Update wording of TODO about handling Observables.
2017-03-22 15:52:54 +00:00

90 lines
2.7 KiB
Groovy

apply plugin: 'kotlin'
apply plugin: 'kotlin-kapt'
apply plugin: 'idea'
apply plugin: 'net.corda.plugins.publish-utils'
description 'Corda node database schemas'
buildscript {
ext.generatedSourcesDir = "${projectDir}/generated/source/kapt/main"
}
repositories {
mavenLocal()
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
jcenter()
maven {
url 'https://dl.bintray.com/kotlin/exposed'
}
}
// Kapt plugin is hardcoded in output directory and sourcesets. Use a separate sourceset to keep the generated
// files in git and outside of the build directory (to avoid cleaning issues)
sourceSets {
main {
kotlin {
srcDir "${buildDir}/generated/source/kapt/main/"
}
}
generated {
java {
srcDir generatedSourcesDir
compileClasspath += sourceSets.main.compileClasspath + sourceSets.main.output
}
}
test {
compileClasspath += sourceSets.generated.output + sourceSets.main.compileClasspath
runtimeClasspath += compileClasspath
}
}
dependencies {
compile project(':core')
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
// Requery: SQL based query & persistence for Kotlin
kapt "io.requery:requery-processor:$requery_version"
// For H2 database support in persistence
testCompile "com.h2database:h2:$h2_version"
}
// Generated files will be removed by gradle clean. Since we aren't running kapt every time we must preserve these files
// Note: The lines that actually invoke kapt are those in the project.afterEvaluate block.
task buildKapt(type: Copy) {
from "${buildDir}/generated"
into "${projectDir}/generated"
}
// Kapt hijacks anything named "compile"
task buildGenerated(type: JavaCompile) {
source = sourceSets.generated.allJava
classpath = sourceSets.generated.compileClasspath + sourceSets.main.compileClasspath + sourceSets.main.output
destinationDir = file("$buildDir/classes/generated")
}
// Remove the dependency on compile in kapt to avoid automatic kapt running - run :node-schemas:kaptKotlin explicitly.
project.afterEvaluate {
jar.dependsOn.each { jar.dependsOn.remove it }
buildGenerated.dependsOn.each { buildGenerated.dependsOn.remove it }
jar.dependsOn buildGenerated
compileTestKotlin.dependsOn buildGenerated
buildGenerated.dependsOn classes
compileKotlin.dependsOn.remove kaptKotlin
compileTestKotlin.dependsOn.remove kaptTestKotlin
buildKapt.dependsOn kaptKotlin
buildKapt.mustRunAfter kaptKotlin
}
jar {
from sourceSets.generated.output
}
idea {
module {
sourceDirs += project.sourceSets.generated.allSource
}
}