Revert "Do not fork java compile tasks when current JDK can be used"
This reverts commit f2021b58
This commit is contained in:
+2
-13
@@ -716,23 +716,12 @@ fun jdkPath(version: String): String {
|
|||||||
|
|
||||||
|
|
||||||
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
|
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
|
||||||
val currentJavaHome = File(System.getProperty("java.home")!!).canonicalPath
|
|
||||||
val shouldFork = !currentJavaHome.startsWith(File(javaHome).canonicalPath)
|
|
||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
tasks.withType<JavaCompile> {
|
||||||
if (name != "compileJava9Java") {
|
if (name != "compileJava9Java") {
|
||||||
sourceCompatibility = javaVersion
|
sourceCompatibility = javaVersion
|
||||||
targetCompatibility = javaVersion
|
targetCompatibility = javaVersion
|
||||||
|
options.isFork = true
|
||||||
if (shouldFork) {
|
options.forkOptions.javaHome = file(javaHome)
|
||||||
logger.info("$path will be forked with $javaHome")
|
|
||||||
options.isFork = true
|
|
||||||
options.forkOptions.javaHome = file(javaHome)
|
|
||||||
} else {
|
|
||||||
options.isFork = false
|
|
||||||
options.forkOptions.javaHome = null
|
|
||||||
}
|
|
||||||
|
|
||||||
options.compilerArgs.add("-proc:none")
|
options.compilerArgs.add("-proc:none")
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user