Drop forcing Java task to recompile
We don't support Gradle <= 3.5 at the moment, it does not make sense to have the code for Gradle < 2.14
This commit is contained in:
-14
@@ -590,20 +590,6 @@ abstract class AbstractAndroidProjectHandler<V>(private val kotlinConfigurationT
|
|||||||
internal fun configureJavaTask(kotlinTask: KotlinCompile, javaTask: AbstractCompile, logger: Logger) {
|
internal fun configureJavaTask(kotlinTask: KotlinCompile, javaTask: AbstractCompile, logger: Logger) {
|
||||||
kotlinTask.javaOutputDir = javaTask.destinationDir
|
kotlinTask.javaOutputDir = javaTask.destinationDir
|
||||||
|
|
||||||
// Gradle Java IC in older Gradle versions (before 2.14) cannot check .class directories updates.
|
|
||||||
// To make it work, reset the up-to-date status of compileJava with this flag.
|
|
||||||
kotlinTask.anyClassesCompiled = false
|
|
||||||
val gradleSupportsJavaIcWithClassesDirs = ParsedGradleVersion.parse(javaTask.project.gradle.gradleVersion)
|
|
||||||
?.let { it >= ParsedGradleVersion(2, 14) } ?: false
|
|
||||||
if (!gradleSupportsJavaIcWithClassesDirs) {
|
|
||||||
javaTask.outputs.upToDateWhen { task ->
|
|
||||||
if (kotlinTask.anyClassesCompiled) {
|
|
||||||
logger.info("Marking $task out of date, because kotlin classes are changed")
|
|
||||||
false
|
|
||||||
} else true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make Gradle check if the javaTask is up-to-date based on the Kotlin classes
|
// Make Gradle check if the javaTask is up-to-date based on the Kotlin classes
|
||||||
javaTask.inputsCompatible.run {
|
javaTask.inputsCompatible.run {
|
||||||
if (isBuildCacheSupported()) {
|
if (isBuildCacheSupported()) {
|
||||||
|
|||||||
-5
@@ -180,10 +180,6 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractKo
|
|||||||
?: coroutinesFromGradleProperties
|
?: coroutinesFromGradleProperties
|
||||||
?: Coroutines.DEFAULT
|
?: Coroutines.DEFAULT
|
||||||
|
|
||||||
// TODO: consider more reliable approach (see usage)
|
|
||||||
@get:Internal
|
|
||||||
internal var anyClassesCompiled: Boolean = false
|
|
||||||
|
|
||||||
@get:Internal
|
@get:Internal
|
||||||
internal var friendTaskName: String? = null
|
internal var friendTaskName: String? = null
|
||||||
|
|
||||||
@@ -401,7 +397,6 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
|
|||||||
cleanupOnError()
|
cleanupOnError()
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
anyClassesCompiled = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun disableMultiModuleICIfNeeded() {
|
private fun disableMultiModuleICIfNeeded() {
|
||||||
|
|||||||
Reference in New Issue
Block a user