Fix Kotlin destination dir added to Java task without normalization.

Issue #KT-20604 Fixed
This commit is contained in:
Sergey Igushkin
2017-12-11 20:39:09 +03:00
parent 97edda44c8
commit 67b5527c68
@@ -688,7 +688,14 @@ internal fun configureJavaTask(kotlinTask: KotlinCompile, javaTask: AbstractComp
}
// Make Gradle check if the javaTask is up-to-date based on the Kotlin classes
javaTask.inputsCompatible.dirCompatible(kotlinTask.destinationDir)
javaTask.inputsCompatible.run {
if (shouldEnableGradleCache()) {
dir(kotlinTask.destinationDir).withNormalizer(ClasspathNormalizer::class.java)
}
else {
dirCompatible(kotlinTask.destinationDir)
}
}
// Also, use kapt1 annotations file for up-to-date check since annotation processing is done with javac
kotlinTask.kaptOptions.annotationsFile?.let { javaTask.inputsCompatible.fileCompatible(it) }