KT-45777: Compute classpath changes based on changed snapshots only

to avoid unnecessarily loading unchanged ones.

Duplicate classes will make this a bit tricky. This commit outlines the
algorithm to handle them, the full implementation will follow later.

Also handle removed classes when computing classpath changes.

Test: New tests in ClasspathChangesComputerTest
This commit is contained in:
Hung Nguyen
2021-09-21 09:49:04 +01:00
committed by nataliya.valtman
parent c2af8b2a29
commit e26dc4d574
28 changed files with 482 additions and 175 deletions
@@ -109,15 +109,17 @@ abstract class AbstractIncrementalCache<ClassName>(
override fun markDirty(removedAndCompiledSources: Collection<File>) {
for (sourceFile in removedAndCompiledSources) {
val classes = sourceToClassesMap[sourceFile]
classes.forEach {
dirtyOutputClassesMap.markDirty(it)
sourceToClassesMap[sourceFile].forEach { className ->
markDirty(className)
}
sourceToClassesMap.clearOutputsForSource(sourceFile)
}
}
fun markDirty(className: ClassName) {
dirtyOutputClassesMap.markDirty(className)
}
/**
* Updates class storage based on the given class proto.
*