mirror of
https://github.com/corda/corda.git
synced 2024-12-21 05:53:23 +00:00
27ea570fbb
* CORDA-3696: Temporary update to enable JDK11 build and test. Will eventually be switchable. * CORDA-3696: Filter out the Nashorn warning. * CORDA-3696: Add JDK11 classifier. * CORDA-3696: Updated match string to cope with JDK11. * CORDA-3696: Filtering out SPHINCS256_SHA256 where failing due to JDK11. * CORDA-3696: Now remove SPHINCS256_SHA256 only if JDK11. * CORDA-3696: Fix test failure - switch to regex matching. * CORDA-3696: Hide the illegal access warnings. * CORDA-3696: Check for Java11 when disabling Java11 warnings. * CORDA-3696: Fix unneccessary non null check. * CORDA-3696: Reverting build env to JDK8 * CORDA-3696: Revert hiding of illegal access warnings via Unsafe class. * CORDA-3696: Remove internal access warnings and new JDK11 version checker. * CORDA-3696: Updated build file for OS * CORDA-3696: Removed typo * CORDA-3696: Fixed space typo. * CORDA-3696: Open modules to remove the illegal access warnings. Co-authored-by: Adel El-Beik <adelel-beik@19LDN-MAC108.local>
135 lines
6.0 KiB
Groovy
135 lines
6.0 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 standalone node'
|
|
|
|
evaluationDependsOn(':node')
|
|
|
|
configurations {
|
|
runtimeArtifacts.extendsFrom runtimeClasspath
|
|
capsuleRuntime
|
|
}
|
|
|
|
dependencies {
|
|
// TypeSafe Config: for simple and human friendly config files.
|
|
capsuleRuntime "com.typesafe:config:$typesafe_config_version"
|
|
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"
|
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}"
|
|
testImplementation "junit:junit:$junit_version"
|
|
}
|
|
|
|
jar.enabled = false
|
|
|
|
capsule {
|
|
version capsule_version
|
|
}
|
|
|
|
def nodeProject = project(':node')
|
|
|
|
task buildCordaJAR(type: FatCapsule, dependsOn: [
|
|
nodeProject.tasks.jar,
|
|
project(':core-deterministic').tasks.assemble,
|
|
project(':serialization-deterministic').tasks.assemble
|
|
]) {
|
|
applicationClass 'net.corda.node.Corda'
|
|
archiveBaseName = 'corda'
|
|
archiveVersion = corda_release_version
|
|
archiveClassifier = jdkClassifier
|
|
archiveName = archiveFileName.get()
|
|
applicationSource = files(
|
|
nodeProject.configurations.runtimeClasspath,
|
|
nodeProject.tasks.jar,
|
|
nodeProject.buildDir.toString() + '/resources/main/reference.conf',
|
|
"$rootDir/config/dev/log4j2.xml",
|
|
'NOTICE' // Copy CDDL notice
|
|
)
|
|
from configurations.capsuleRuntime.files.collect { zipTree(it) }
|
|
with jar
|
|
|
|
// 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(' '))
|
|
|
|
if (JavaVersion.current() == JavaVersion.VERSION_11) {
|
|
attributes('Add-Opens': 'java.management/com.sun.jmx.mbeanserver java.base/java.lang')
|
|
}
|
|
|
|
}
|
|
|
|
into('djvm') {
|
|
from nodeProject.configurations['jdkRt'].singleFile
|
|
from deterministicResolved.values()
|
|
fileMode = 0444
|
|
}
|
|
|
|
capsuleManifest {
|
|
applicationVersion = corda_release_version
|
|
applicationId = "net.corda.node.Corda"
|
|
// See experimental/quasar-hook/README.md for how to generate.
|
|
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**)"
|
|
def quasarClassLoaderExclusion = "l(net.corda.djvm.**;net.corda.core.serialization.internal.**)"
|
|
javaAgents = quasar_classifier ? ["quasar-core-${quasar_version}-${quasar_classifier}.jar=${quasarExcludeExpression}${quasarClassLoaderExclusion}"] : ["quasar-core-${quasar_version}.jar=${quasarExcludeExpression}${quasarClassLoaderExclusion}"]
|
|
systemProperties['visualvm.display.name'] = 'Corda'
|
|
if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
|
|
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.
|
|
// NOTE: these can be overridden in node.conf.
|
|
//
|
|
// If you change these flags, please also update Driver.kt
|
|
jvmArgs = ['-Xmx512m', '-XX:+UseG1GC']
|
|
if (JavaVersion.current() == JavaVersion.VERSION_11) {
|
|
jvmArgs += ['-Djdk.attach.allowAttachSelf=true']
|
|
}
|
|
}
|
|
}
|
|
|
|
assemble.dependsOn buildCordaJAR
|
|
|
|
artifacts {
|
|
runtimeArtifacts buildCordaJAR
|
|
publish buildCordaJAR {
|
|
classifier ''
|
|
}
|
|
}
|
|
|
|
publish {
|
|
disableDefaultJar = true
|
|
name 'corda'
|
|
}
|