Skip to content

Commit

Permalink
Add config library and default config to webserver JAR (corda#2047)
Browse files Browse the repository at this point in the history
* Add config library and default config to webserver JAR

* Applied Clinton's feedback to create a config rather than do filtering.
  • Loading branch information
rick-r3 authored Nov 15, 2017
1 parent 92c8861 commit 7337996
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
14 changes: 9 additions & 5 deletions node/capsule/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 9 additions & 1 deletion webserver/webcapsule/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7337996

Please sign in to comment.