forked from corda/corda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENT-1463, ENT-1903: Refactor Gradle for deterministic modules (corda#…
…3387) * Export locations of both deterministic rt.jar and its JDK_HOME as properties. * Refactor deterministic Java/Kotlin configuration into a script plugin.
- Loading branch information
Showing
5 changed files
with
35 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters