Request CHUNK_REBUILD when IC is off and there are dirty Kotlin files

Otherwise unexpected compile error might happen,
when there are Groovy files, but they are not dirty,
so Groovy builder does not generate source stubs,
and Kotlin builder is filtering out output directory
from classpath (because it may contain outdated Java classes).

Previously the issue was not detected,
because it was not possible to turn off the IC completely (in JPS),
only switch to the legacy IC.

    #KT-20138

Original commit: 7a5e0e1107
This commit is contained in:
Alexey Tsvetkov
2017-09-19 06:30:00 +03:00
parent 345ae1382d
commit 6d868d3d67
4 changed files with 117 additions and 15 deletions
@@ -238,7 +238,13 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
val isChunkRebuilding = JavaBuilderUtil.isForcedRecompilationAllJavaModules(context)
|| targets.any { rebuildAfterCacheVersionChanged[it] == true }
if (!hasKotlinDirtyOrRemovedFiles(dirtyFilesHolder, chunk)) {
if (hasKotlinDirtyOrRemovedFiles(dirtyFilesHolder, chunk)) {
if (!isChunkRebuilding && !IncrementalCompilation.isEnabled()) {
targets.forEach { rebuildAfterCacheVersionChanged[it] = true }
return CHUNK_REBUILD_REQUIRED
}
}
else {
if (isChunkRebuilding) {
targets.forEach { hasKotlin[it] = false }
}