2016-12-06 15:25:38 +00:00
|
|
|
/**
|
|
|
|
* 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'
|
2017-06-26 17:07:56 +00:00
|
|
|
apply plugin: 'com.jfrog.artifactory'
|
2016-12-06 15:25:38 +00:00
|
|
|
|
|
|
|
description 'Corda standalone node'
|
|
|
|
|
2019-11-05 13:44:18 +00:00
|
|
|
evaluationDependsOn(':node')
|
|
|
|
|
2016-12-06 15:25:38 +00:00
|
|
|
configurations {
|
2018-09-06 11:48:31 +00:00
|
|
|
runtimeArtifacts.extendsFrom runtimeClasspath
|
2017-11-15 15:03:15 +00:00
|
|
|
capsuleRuntime
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
// TypeSafe Config: for simple and human friendly config files.
|
|
|
|
capsuleRuntime "com.typesafe:config:$typesafe_config_version"
|
2019-06-07 07:55:19 +00:00
|
|
|
compileOnly "com.typesafe:config:$typesafe_config_version"
|
|
|
|
testRuntimeOnly "com.typesafe:config:$typesafe_config_version"
|
|
|
|
|
|
|
|
// Capsule is a library for building independently executable fat JARs.
|
|
|
|
// We only need this dependency to compile our Caplet against.
|
|
|
|
compileOnly "co.paralleluniverse:capsule:$capsule_version"
|
|
|
|
testCompile "co.paralleluniverse:capsule:$capsule_version"
|
2016-12-06 15:25:38 +00:00
|
|
|
|
2019-06-07 07:55:19 +00:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}"
|
|
|
|
testImplementation "junit:junit:$junit_version"
|
|
|
|
}
|
2016-12-06 15:25:38 +00:00
|
|
|
|
2018-09-06 11:48:31 +00:00
|
|
|
jar.enabled = false
|
|
|
|
|
2018-09-17 12:55:31 +00:00
|
|
|
capsule {
|
|
|
|
version capsule_version
|
|
|
|
}
|
|
|
|
|
2019-11-05 13:44:18 +00:00
|
|
|
def nodeProject = project(':node')
|
|
|
|
|
|
|
|
task buildCordaJAR(type: FatCapsule, dependsOn: [
|
2020-07-13 09:33:23 +00:00
|
|
|
nodeProject.tasks.named('jar'),
|
|
|
|
project(':core-deterministic').tasks.named('assemble'),
|
|
|
|
project(':serialization-deterministic').tasks.named('assemble')
|
2019-11-05 13:44:18 +00:00
|
|
|
]) {
|
2017-01-11 17:43:45 +00:00
|
|
|
applicationClass 'net.corda.node.Corda'
|
2019-10-08 09:45:10 +00:00
|
|
|
archiveBaseName = 'corda'
|
|
|
|
archiveVersion = corda_release_version
|
|
|
|
archiveClassifier = jdkClassifier
|
|
|
|
archiveName = archiveFileName.get()
|
2017-05-05 12:12:36 +00:00
|
|
|
applicationSource = files(
|
2019-11-05 13:44:18 +00:00
|
|
|
nodeProject.configurations.runtimeClasspath,
|
|
|
|
nodeProject.tasks.jar,
|
2020-06-16 08:15:51 +00:00
|
|
|
nodeProject.buildDir.toString() + '/resources/main/corda-reference.conf',
|
2018-09-06 11:48:31 +00:00
|
|
|
"$rootDir/config/dev/log4j2.xml",
|
|
|
|
'NOTICE' // Copy CDDL notice
|
2017-05-05 12:12:36 +00:00
|
|
|
)
|
2017-11-15 15:03:15 +00:00
|
|
|
from configurations.capsuleRuntime.files.collect { zipTree(it) }
|
2019-06-07 07:55:19 +00:00
|
|
|
with jar
|
2017-05-10 17:42:21 +00:00
|
|
|
|
2019-11-05 13:44:18 +00:00
|
|
|
// The DJVM will share most of its dependencies with the node, but any extra ones that it needs
|
|
|
|
// are listed in the node's "deterministic" configuration and copied into a djvm subdirectory.
|
|
|
|
//
|
|
|
|
// Gradle may not resolve exactly the same transitive dependencies for both the runtimeClasspath
|
|
|
|
// and deterministic configurations - specifically, the artifacts' version numbers may differ slightly.
|
|
|
|
// And so we map the files by the resolved ModuleIdentifier objects instead, which just contain an
|
|
|
|
// artifact's group and name.
|
|
|
|
def cordaResolved = nodeProject.configurations['runtimeClasspath'].resolvedConfiguration.resolvedArtifacts.collectEntries {
|
|
|
|
[ (it.moduleVersion.id.module):it.file ]
|
|
|
|
}
|
|
|
|
def deterministicResolved = nodeProject.configurations['deterministic'].resolvedConfiguration.resolvedArtifacts.collectEntries {
|
|
|
|
[ (it.moduleVersion.id.module):it.file ]
|
|
|
|
}
|
|
|
|
def resolvedDifferences = deterministicResolved.keySet() - cordaResolved.keySet()
|
|
|
|
|
|
|
|
cordaResolved.keySet().retainAll(deterministicResolved.keySet() - resolvedDifferences)
|
|
|
|
deterministicResolved.keySet().retainAll(resolvedDifferences)
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
// These are the dependencies that the deterministic Corda libraries share with Corda.
|
|
|
|
attributes('Corda-DJVM-Dependencies': cordaResolved.values().collect { it.name }.join(' '))
|
2020-04-16 09:20:30 +00:00
|
|
|
|
|
|
|
if (JavaVersion.current() == JavaVersion.VERSION_11) {
|
|
|
|
attributes('Add-Opens': 'java.management/com.sun.jmx.mbeanserver java.base/java.lang')
|
|
|
|
}
|
|
|
|
|
2019-11-05 13:44:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
into('djvm') {
|
|
|
|
from nodeProject.configurations['jdkRt'].singleFile
|
|
|
|
from deterministicResolved.values()
|
|
|
|
fileMode = 0444
|
|
|
|
}
|
|
|
|
|
2016-12-06 15:25:38 +00:00
|
|
|
capsuleManifest {
|
2017-04-19 10:05:27 +00:00
|
|
|
applicationVersion = corda_release_version
|
2018-11-22 13:53:14 +00:00
|
|
|
applicationId = "net.corda.node.Corda"
|
2017-08-30 16:13:25 +00:00
|
|
|
// See experimental/quasar-hook/README.md for how to generate.
|
2019-11-05 13:44:18 +00:00
|
|
|
def quasarExcludeExpression = "x(antlr**;bftsmart**;co.paralleluniverse**;com.codahale**;com.esotericsoftware**;com.fasterxml**;com.google**;com.ibm**;com.intellij**;com.jcabi**;com.nhaarman**;com.opengamma**;com.typesafe**;com.zaxxer**;de.javakaffee**;groovy**;groovyjarjarantlr**;groovyjarjarasm**;io.atomix**;io.github**;io.netty**;jdk**;kotlin**;net.corda.djvm**;djvm**;net.bytebuddy**;net.i2p**;org.apache**;org.bouncycastle**;org.codehaus**;org.crsh**;org.dom4j**;org.fusesource**;org.h2**;org.hibernate**;org.jboss**;org.jcp**;org.joda**;org.objectweb**;org.objenesis**;org.slf4j**;org.w3c**;org.xml**;org.yaml**;reflectasm**;rx**;org.jolokia**;com.lmax**;picocli**;liquibase**;com.github.benmanes**;org.json**;org.postgresql**;nonapi.io.github.classgraph**)"
|
2020-03-18 13:59:10 +00:00
|
|
|
def quasarClassLoaderExclusion = "l(net.corda.djvm.**;net.corda.core.serialization.internal.**)"
|
2020-03-31 14:32:36 +00:00
|
|
|
javaAgents = quasar_classifier ? ["quasar-core-${quasar_version}-${quasar_classifier}.jar=${quasarExcludeExpression}${quasarClassLoaderExclusion}"] : ["quasar-core-${quasar_version}.jar=${quasarExcludeExpression}${quasarClassLoaderExclusion}"]
|
2017-01-11 17:43:45 +00:00
|
|
|
systemProperties['visualvm.display.name'] = 'Corda'
|
2019-09-18 09:26:26 +00:00
|
|
|
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
|
|
|
|
minJavaVersion = '1.8.0'
|
|
|
|
minUpdateVersion['1.8'] = java8_minUpdateVersion
|
|
|
|
}
|
2016-12-06 15:25:38 +00:00
|
|
|
caplets = ['CordaCaplet']
|
2017-01-11 17:43:45 +00:00
|
|
|
|
|
|
|
// 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.
|
2017-10-24 15:49:47 +00:00
|
|
|
// NOTE: these can be overridden in node.conf.
|
2017-01-11 17:43:45 +00:00
|
|
|
//
|
|
|
|
// If you change these flags, please also update Driver.kt
|
2018-03-26 12:41:37 +00:00
|
|
|
jvmArgs = ['-Xmx512m', '-XX:+UseG1GC']
|
2019-11-05 13:44:18 +00:00
|
|
|
if (JavaVersion.current() == JavaVersion.VERSION_11) {
|
2019-09-18 09:26:26 +00:00
|
|
|
jvmArgs += ['-Djdk.attach.allowAttachSelf=true']
|
2019-11-05 13:44:18 +00:00
|
|
|
}
|
2016-12-06 15:25:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
2020-07-07 08:08:58 +00:00
|
|
|
archives buildCordaJAR
|
2016-12-06 15:25:38 +00:00
|
|
|
runtimeArtifacts buildCordaJAR
|
|
|
|
publish buildCordaJAR {
|
2018-09-06 11:48:31 +00:00
|
|
|
classifier ''
|
2016-12-06 15:25:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publish {
|
|
|
|
disableDefaultJar = true
|
2017-07-18 11:34:56 +00:00
|
|
|
name 'corda'
|
2017-01-03 14:15:23 +00:00
|
|
|
}
|