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
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user