mirror of
https://github.com/corda/corda.git
synced 2025-01-17 18:29:49 +00:00
825c544cac
* WIP - sandbox classloading * Fix handling of Appendable in the sandbox. * WIP - Load wrapped Java types into SandboxClassLoader. * Add explicit toDJVM() invocation after invoking Object.toString(). * Add simple ThreadLocal to the sandbox to complete AbstractStringBuilder. * Add support for Enum types inside the sandbox. * Simplify type conversions into and out of the sandbox. * Small refactors and comments to tidy up code. * Fix Enum support to include EnumSet and EnumMap. * Fix use of "$" in whitelist regexps. * Add extra methods (i.e. bridges) to stitched interfaces. * Rename ToDJVMStringWrapper to StringReturnTypeWrapper. * Support lambdas within the sandbox. * Fix mapping of java.lang.System into the sandbox. * Don't remap exception classes that we catch into sandbox classes. * Remove unnecessary "bootstrap" classes from the DJVM jar. * Ensure that Character.UnicodeScript is available inside the sandbox. * Tweak sandboxed implementations of System and Runtime. * Ensure that Character.UnicodeScript is loaded correctly as Enum type. * Disallow invoking methods of ClassLoader inside the sandbox. * Apply updates after review. * More review fixes.
91 lines
2.4 KiB
Groovy
91 lines
2.4 KiB
Groovy
plugins {
|
|
id 'com.github.johnrengelman.shadow'
|
|
}
|
|
apply plugin: 'net.corda.plugins.publish-utils'
|
|
apply plugin: 'com.jfrog.artifactory'
|
|
apply plugin: 'idea'
|
|
|
|
description 'Corda deterministic JVM sandbox'
|
|
|
|
ext {
|
|
// Shaded version of ASM to avoid conflict with root project.
|
|
asm_version = '6.2.1'
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url "$artifactory_contextUrl/corda-dev"
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
testCompile.extendsFrom shadow
|
|
jdkRt.resolutionStrategy {
|
|
// Always check the repository for a newer SNAPSHOT.
|
|
cacheChangingModulesFor 0, 'seconds'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
shadow "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
shadow "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
|
shadow "org.slf4j:slf4j-api:$slf4j_version"
|
|
|
|
// ASM: byte code manipulation library
|
|
compile "org.ow2.asm:asm:$asm_version"
|
|
compile "org.ow2.asm:asm-tree:$asm_version"
|
|
compile "org.ow2.asm:asm-commons:$asm_version"
|
|
|
|
// Classpath scanner
|
|
shadow "io.github.lukehutch:fast-classpath-scanner:$fast_classpath_scanner_version"
|
|
|
|
// Test utilities
|
|
testCompile "junit:junit:$junit_version"
|
|
testCompile "org.assertj:assertj-core:$assertj_version"
|
|
testCompile "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
|
|
jdkRt "net.corda:deterministic-rt:latest.integration"
|
|
}
|
|
|
|
jar.enabled = false
|
|
|
|
shadowJar {
|
|
baseName 'corda-djvm'
|
|
classifier ''
|
|
relocate 'org.objectweb.asm', 'djvm.org.objectweb.asm'
|
|
|
|
// These particular classes are only needed to "bootstrap"
|
|
// the compilation of the other sandbox classes. At runtime,
|
|
// we will generate better versions from deterministic-rt.jar.
|
|
exclude 'sandbox/java/lang/Appendable.class'
|
|
exclude 'sandbox/java/lang/CharSequence.class'
|
|
exclude 'sandbox/java/lang/Character\$*.class'
|
|
exclude 'sandbox/java/lang/Comparable.class'
|
|
exclude 'sandbox/java/lang/Enum.class'
|
|
exclude 'sandbox/java/lang/Iterable.class'
|
|
exclude 'sandbox/java/lang/StringBuffer.class'
|
|
exclude 'sandbox/java/lang/StringBuilder.class'
|
|
exclude 'sandbox/java/nio/**'
|
|
exclude 'sandbox/java/util/**'
|
|
}
|
|
assemble.dependsOn shadowJar
|
|
|
|
tasks.withType(Test) {
|
|
systemProperty 'deterministic-rt.path', configurations.jdkRt.asPath
|
|
}
|
|
|
|
artifacts {
|
|
publish shadowJar
|
|
}
|
|
|
|
publish {
|
|
dependenciesFrom configurations.shadow
|
|
name shadowJar.baseName
|
|
}
|
|
|
|
idea {
|
|
module {
|
|
downloadJavadoc = true
|
|
downloadSources = true
|
|
}
|
|
}
|