mirror of
https://github.com/corda/corda.git
synced 2024-12-24 07:06:44 +00:00
CID-251: Integrate DJVM with Corda's existing deterministic-rt. (#3846)
* Integrate DJVM with Corda's existing deterministic-rt. * Remove generated whitelists from DJVM. * Fix Manifest attributes, disable jar tasks and attach shadowJar to assemble task.
This commit is contained in:
parent
8b0fc8f29c
commit
329c9da0a9
@ -1,20 +1,10 @@
|
||||
buildscript {
|
||||
// Shaded version of ASM to avoid conflict with root project.
|
||||
ext.asm_version = '6.1.1'
|
||||
ext.deterministic_rt_version = '1.0-20180625.120901-7'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
|
||||
}
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '2.0.4'
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '2.0.3'
|
||||
ext {
|
||||
// Shaded version of ASM to avoid conflict with root project.
|
||||
asm_version = '6.1.1'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -32,47 +22,16 @@ dependencies {
|
||||
// Classpath scanner
|
||||
compile "io.github.lukehutch:fast-classpath-scanner:$fast_classpath_scanner_version"
|
||||
|
||||
// Deterministic runtime - used in whitelist generation
|
||||
runtime "net.corda:deterministic-rt:$deterministic_rt_version:api"
|
||||
|
||||
// Test utilities
|
||||
testCompile "junit:junit:$junit_version"
|
||||
testCompile "org.assertj:assertj-core:$assertj_version"
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven {
|
||||
url "$artifactory_contextUrl/corda-dev"
|
||||
}
|
||||
}
|
||||
|
||||
task generateWhitelist(type: JavaExec) {
|
||||
// This is an example of how a whitelist can be generated from a JAR. In most applications though, it is recommended
|
||||
// thet the minimal set whitelist is used.
|
||||
def jars = configurations.runtime.collect {
|
||||
it.toString()
|
||||
}.findAll {
|
||||
it.toString().contains("deterministic-rt")
|
||||
}
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
main = 'net.corda.djvm.tools.cli.Program'
|
||||
args = ['whitelist', 'generate', '-o', 'src/main/resources/jdk8-deterministic.dat.gz'] + jars
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
'Automatic-Module-Name': 'net.corda.djvm'
|
||||
)
|
||||
}
|
||||
}
|
||||
jar.enabled = false
|
||||
|
||||
shadowJar {
|
||||
baseName = "djvm"
|
||||
classifier = ""
|
||||
exclude 'deterministic-rt*.jar'
|
||||
dependencies {
|
||||
exclude(dependency('com.jcabi:.*:.*'))
|
||||
exclude(dependency('org.apache.*:.*:.*'))
|
||||
@ -87,3 +46,4 @@ shadowJar {
|
||||
}
|
||||
}
|
||||
}
|
||||
assemble.dependsOn shadowJar
|
||||
|
@ -1,16 +1,15 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow'
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "$artifactory_contextUrl/corda-dev"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow'
|
||||
configurations {
|
||||
deterministicRt
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -23,23 +22,29 @@ dependencies {
|
||||
compile "info.picocli:picocli:$picocli_version"
|
||||
compile "io.github.lukehutch:fast-classpath-scanner:$fast_classpath_scanner_version"
|
||||
compile project(path: ":djvm", configuration: "shadow")
|
||||
|
||||
// Deterministic runtime - used in whitelist generation
|
||||
deterministicRt project(path: ':jdk8u-deterministic', configuration: 'jdk')
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': 'net.corda.djvm.tools.cli.Program',
|
||||
'Automatic-Module-Name': 'net.corda.djvm',
|
||||
'Build-Date': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
)
|
||||
}
|
||||
}
|
||||
jar.enabled = false
|
||||
|
||||
shadowJar {
|
||||
baseName = "corda-djvm"
|
||||
classifier = 'cli'
|
||||
manifest {
|
||||
attributes(
|
||||
'Automatic-Module-Name': 'net.corda.djvm',
|
||||
'Main-Class': 'net.corda.djvm.tools.cli.Program',
|
||||
'Build-Date': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||
)
|
||||
}
|
||||
}
|
||||
assemble.dependsOn shadowJar
|
||||
|
||||
task generateWhitelist(type: JavaExec, dependsOn: shadowJar) {
|
||||
// This is an example of how a whitelist can be generated from a JAR. In most applications though, it is recommended
|
||||
// that the minimal set whitelist is used.
|
||||
main = '-jar'
|
||||
args = [shadowJar.outputs.files.singleFile, 'whitelist', 'generate', '-o', "$buildDir/jdk8-deterministic.dat.gz", configurations.deterministicRt.files[0] ]
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -45,3 +45,7 @@ task copyJdk(type: Copy) {
|
||||
|
||||
assemble.dependsOn copyJdk
|
||||
jar.enabled = false
|
||||
|
||||
artifacts {
|
||||
jdk file: file(rt_jar), type: 'jar', builtBy: copyJdk
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user