mirror of
https://github.com/corda/corda.git
synced 2024-12-30 17:57:02 +00:00
9148d0529a
* Export locations of both deterministic rt.jar and its JDK_HOME as properties. * Refactor deterministic Java/Kotlin configuration into a script plugin.
30 lines
880 B
Groovy
30 lines
880 B
Groovy
/*
|
|
* 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.
|
|
*/
|
|
apply plugin: 'kotlin'
|
|
|
|
evaluationDependsOn(':jdk8u-deterministic')
|
|
|
|
def jdk8uDeterministic = project(':jdk8u-deterministic')
|
|
|
|
ext {
|
|
jdkTask = jdk8uDeterministic.assemble
|
|
deterministic_jdk_home = jdk8uDeterministic.jdk_home
|
|
deterministic_rt_jar = jdk8uDeterministic.rt_jar
|
|
}
|
|
|
|
tasks.withType(AbstractCompile) {
|
|
dependsOn jdkTask
|
|
|
|
// 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
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs << '-bootclasspath' << deterministic_rt_jar
|
|
}
|