mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
CORDA-2876: Ensure that sandboxable byte-code is compiled for Java 8.
This commit is contained in:
parent
4a8c73bf4a
commit
b1c164e26d
@ -1,3 +1,5 @@
|
||||
import static org.gradle.api.JavaVersion.VERSION_1_8
|
||||
|
||||
/*
|
||||
* Gradle script plugin: Configure a module such that the Java and Kotlin
|
||||
* compilers use the deterministic rt.jar instead of the full JDK rt.jar.
|
||||
@ -19,11 +21,16 @@ tasks.withType(AbstractCompile) {
|
||||
|
||||
// This is a bit ugly, but Gradle isn't recognising the KotlinCompile task
|
||||
// as it does the built-in JavaCompile task.
|
||||
if (it.class.name.startsWith("org.jetbrains.kotlin.gradle.tasks.KotlinCompile")) {
|
||||
kotlinOptions.jdkHome = deterministic_jdk_home
|
||||
if (it.class.name.startsWith('org.jetbrains.kotlin.gradle.tasks.KotlinCompile')) {
|
||||
kotlinOptions {
|
||||
jdkHome = deterministic_jdk_home
|
||||
jvmTarget = VERSION_1_8
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << '-bootclasspath' << deterministic_rt_jar
|
||||
sourceCompatibility = VERSION_1_8
|
||||
targetCompatibility = VERSION_1_8
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
import static org.gradle.api.JavaVersion.VERSION_1_8
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
id 'net.corda.plugins.publish-utils'
|
||||
@ -42,6 +44,18 @@ dependencies {
|
||||
sandboxTesting "org.slf4j:slf4j-nop:$slf4j_version"
|
||||
}
|
||||
|
||||
// The DJVM only supports Java 8 byte-code.
|
||||
compileTestJava {
|
||||
sourceCompatibility = VERSION_1_8
|
||||
targetCompatibility = VERSION_1_8
|
||||
}
|
||||
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveBaseName = 'corda-serialization-djvm'
|
||||
manifest {
|
||||
|
Loading…
Reference in New Issue
Block a user