corda/webserver/webcapsule/build.gradle
Clinton 0ccfae252f POMs generated by publishing are now correct. (#1055)
* POMs generated by publishing are now correct. The publish extension now requires an explicit call to configure the publishing instead of waiting until after evaluation. This prevents evaluation order issues with the artifact renaming code that causes the POM to have the original, incorrect, artifact names.

* Fixed new test compile issues caused by removal of some dependencies in test utils that caused webserver code to be automatically included in any project also compiling test utils.
2017-07-18 12:34:56 +01:00

63 lines
2.4 KiB
Groovy

/**
* This build.gradle exists to publish our capsule (executable fat jar) to maven. It cannot be placed in the
* node project because the bintray plugin cannot publish two modules from one project.
*/
apply plugin: 'net.corda.plugins.publish-utils'
apply plugin: 'us.kirchmeier.capsule'
apply plugin: 'com.jfrog.artifactory'
description 'Corda node web server capsule'
configurations {
runtimeArtifacts
}
// Force the Caplet to target Java 6. This ensures that running 'java -jar corda.jar' on any Java 6 VM upwards
// will get as far as the Capsule version checks, meaning that if your JVM is too old, you will at least get
// a sensible error message telling you what to do rather than a bytecode version exception that doesn't.
// If we introduce .java files into this module that need Java 8+ then we will have to push the caplet into
// its own module so its target can be controlled individually, but for now this suffices.
sourceCompatibility = 1.6
targetCompatibility = 1.6
task buildWebserverJar(type: FatCapsule, dependsOn: project(':node').compileJava) {
applicationClass 'net.corda.webserver.WebServer'
archiveName "corda-webserver-${corda_release_version}.jar"
applicationSource = files(
project(':webserver').configurations.runtime,
project(':webserver').jar,
new File(project(':node').buildDir, 'classes/main/CordaCaplet.class'),
new File(project(':node').buildDir, 'classes/main/CordaCaplet$1.class'),
"$rootDir/config/dev/log4j2.xml"
)
from 'NOTICE' // Copy CDDL notice
capsuleManifest {
applicationVersion = corda_release_version
javaAgents = ["quasar-core-${quasar_version}-jdk8.jar"]
systemProperties['visualvm.display.name'] = 'Corda Webserver'
minJavaVersion = '1.8.0'
minUpdateVersion['1.8'] = java8_minUpdateVersion
caplets = ['CordaCaplet']
// JVM configuration:
// - Constrain to small heap sizes to ease development on low end devices.
// - Switch to the G1 GC which is going to be the default in Java 9 and gives low pause times/string dedup.
//
// If you change these flags, please also update Driver.kt
jvmArgs = ['-Xmx200m', '-XX:+UseG1GC']
}
}
artifacts {
runtimeArtifacts buildWebserverJar
publish buildWebserverJar {
classifier ""
}
}
publish {
disableDefaultJar = true
name 'corda-webserver'
}