Modify how Gradle creates capsules: (#730)

- Better Gradle dependency management.
- Remove empty module jars from the capsules.
This commit is contained in:
Chris Rankin 2017-05-23 18:04:20 +01:00 committed by GitHub
parent 36a091dd6a
commit 179eccdd20
3 changed files with 14 additions and 20 deletions

View File

@ -19,15 +19,12 @@ configurations {
sourceCompatibility = 1.6 sourceCompatibility = 1.6
targetCompatibility = 1.6 targetCompatibility = 1.6
dependencies { task buildCordaJAR(type: FatCapsule, dependsOn: project(':node').compileJava) {
compile project(':node')
}
task buildCordaJAR(type: FatCapsule) {
applicationClass 'net.corda.node.Corda' applicationClass 'net.corda.node.Corda'
archiveName "corda-${corda_release_version}.jar" archiveName "corda-${corda_release_version}.jar"
applicationSource = files( applicationSource = files(
project.tasks.findByName('jar'), project(':node').configurations.compile,
project(':node').jar,
'../build/classes/main/CordaCaplet.class', '../build/classes/main/CordaCaplet.class',
'../build/classes/main/CordaCaplet$1.class', '../build/classes/main/CordaCaplet$1.class',
"$rootDir/config/dev/log4j2.xml" "$rootDir/config/dev/log4j2.xml"

View File

@ -25,14 +25,14 @@ repositories {
sourceCompatibility = 1.6 sourceCompatibility = 1.6
targetCompatibility = 1.6 targetCompatibility = 1.6
dependencies { task buildExplorerJAR(type: FatCapsule, dependsOn: project(':tools:explorer').compileJava) {
compile project(':tools:explorer')
}
task buildExplorerJAR(type: FatCapsule) {
applicationClass 'net.corda.explorer.Main' applicationClass 'net.corda.explorer.Main'
archiveName "node-explorer-${corda_release_version}.jar" archiveName "node-explorer-${corda_release_version}.jar"
applicationSource = files(project.tasks.findByName('jar'), '../build/classes/main/ExplorerCaplet.class') applicationSource = files(
project(':tools:explorer').configurations.compile,
project(':tools:explorer').jar,
'../build/classes/main/ExplorerCaplet.class'
)
classifier 'fat' classifier 'fat'
capsuleManifest { capsuleManifest {

View File

@ -19,17 +19,14 @@ configurations {
sourceCompatibility = 1.6 sourceCompatibility = 1.6
targetCompatibility = 1.6 targetCompatibility = 1.6
dependencies { task buildWebserverJar(type: FatCapsule, dependsOn: project(':node').compileJava) {
compile project(':webserver')
}
task buildWebserverJar(type: FatCapsule) {
applicationClass 'net.corda.webserver.WebServer' applicationClass 'net.corda.webserver.WebServer'
archiveName "corda-webserver-${corda_release_version}.jar" archiveName "corda-webserver-${corda_release_version}.jar"
applicationSource = files( applicationSource = files(
project.tasks.findByName('jar'), project(':webserver').configurations.compile,
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet.class'), project(':webserver').jar,
new File(project(':node').rootDir, 'node/build/classes/main/CordaCaplet$1.class'), new File(project(':node').buildDir, 'classes/main/CordaCaplet.class'),
new File(project(':node').buildDir, 'classes/main/CordaCaplet$1.class'),
"$rootDir/config/dev/log4j2.xml" "$rootDir/config/dev/log4j2.xml"
) )
from 'NOTICE' // Copy CDDL notice from 'NOTICE' // Copy CDDL notice