Track inter-project IC changes for Java
This commit is contained in:
+1
@@ -361,6 +361,7 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
|
||||
for (task in project.tasks.withType(KotlinCompile::class.java)) {
|
||||
val module = IncrementalModuleEntry(project.path, task.moduleName, project.buildDir, task.buildHistoryFile)
|
||||
dirToModule[task.destinationDir] = module
|
||||
task.javaOutputDir?.let { dirToModule[it] = module }
|
||||
nameToModules.getOrPut(module.name) { HashSet() }.add(module)
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -632,6 +632,8 @@ abstract class AbstractAndroidProjectHandler<V>(private val kotlinConfigurationT
|
||||
}
|
||||
|
||||
internal fun configureJavaTask(kotlinTask: KotlinCompile, javaTask: AbstractCompile, logger: Logger) {
|
||||
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
|
||||
|
||||
+9
-4
@@ -185,10 +185,15 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractKo
|
||||
@get:Internal // takes part in the compiler arguments
|
||||
var friendPaths: Lazy<Array<String>?> = lazy {
|
||||
friendTask?.let { friendTask ->
|
||||
mutableListOf<String>().apply {
|
||||
add((friendTask.javaOutputDir ?: friendTask.destinationDir).absolutePath)
|
||||
addAll(friendTask.attachedClassesDirs.mapNotNull { it.value?.absolutePath })
|
||||
}.toTypedArray()
|
||||
val possibleFriendDirs = ArrayList<File?>().apply {
|
||||
add(friendTask.javaOutputDir)
|
||||
add(friendTask.destinationDir)
|
||||
addAll(friendTask.attachedClassesDirs.map { it.value })
|
||||
}
|
||||
|
||||
possibleFriendDirs.filterNotNullTo(HashSet())
|
||||
.map { it.absolutePath }
|
||||
.toTypedArray()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user