Add config library and default config to webserver JAR (#2047)

* Add config library and default config to webserver JAR

* Applied Clinton's feedback to create a config rather than do filtering.
This commit is contained in:
Rick Parker 2017-11-15 15:03:15 +00:00 committed by GitHub
parent 92c8861802
commit 7337996e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View File

@ -10,6 +10,12 @@ description 'Corda standalone node'
configurations {
runtimeArtifacts.extendsFrom runtime
capsuleRuntime
}
dependencies {
// TypeSafe Config: for simple and human friendly config files.
capsuleRuntime "com.typesafe:config:$typesafe_config_version"
}
// Force the Caplet to target Java 6. This ensures that running 'java -jar corda.jar' on any Java 6 VM upwards
@ -28,13 +34,11 @@ task buildCordaJAR(type: FatCapsule, dependsOn: project(':node').compileJava) {
project(':node').jar,
project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet.class',
project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet$1.class',
"$rootDir/config/dev/log4j2.xml"
"$rootDir/config/dev/log4j2.xml",
"$rootDir/node/build/resources/main/reference.conf"
)
from 'NOTICE' // Copy CDDL notice
from { project(':node').configurations.runtime.allDependencies.matching { // Include config library JAR.
it.group.equals("com.typesafe") && it.name.equals("config")
}.collect { zipTree(project(':node').configurations.runtime.files(it).first()) } }
from { "$rootDir/node/build/resources/main/reference.conf" }
from configurations.capsuleRuntime.files.collect { zipTree(it) }
capsuleManifest {
applicationVersion = corda_release_version

View File

@ -10,6 +10,12 @@ description 'Corda node web server capsule'
configurations {
runtimeArtifacts
capsuleRuntime
}
dependencies {
// TypeSafe Config: for simple and human friendly config files.
capsuleRuntime "com.typesafe:config:$typesafe_config_version"
}
// Force the Caplet to target Java 6. This ensures that running 'java -jar corda.jar' on any Java 6 VM upwards
@ -28,9 +34,11 @@ task buildWebserverJar(type: FatCapsule, dependsOn: project(':node').compileJava
project(':webserver').jar,
project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet.class',
project(':node').sourceSets.main.java.outputDir.toString() + '/CordaCaplet$1.class',
"$rootDir/config/dev/log4j2.xml"
"$rootDir/config/dev/log4j2.xml",
"$rootDir/node/build/resources/main/reference.conf"
)
from 'NOTICE' // Copy CDDL notice
from configurations.capsuleRuntime.files.collect { zipTree(it) }
capsuleManifest {
applicationVersion = corda_release_version