Not clearing incremental cache on compilation error.
This commit is contained in:
@@ -196,10 +196,13 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
}
|
||||
}
|
||||
|
||||
val compilationErrors = Utils.ERRORS_DETECTED_KEY[context, false]
|
||||
|
||||
for ((target, cache) in incrementalCaches) {
|
||||
cache.clearCacheForRemovedFiles(
|
||||
KotlinSourceFileCollector.getRemovedKotlinFiles(dirtyFilesHolder, target),
|
||||
target.getOutputDir()!!
|
||||
target.getOutputDir()!!,
|
||||
!compilationErrors
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -96,12 +96,14 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
||||
return DO_NOTHING
|
||||
}
|
||||
|
||||
public fun clearCacheForRemovedFiles(removedSourceFiles: Collection<String>, outDirectory: File) {
|
||||
public fun clearCacheForRemovedFiles(removedSourceFiles: Collection<String>, outDirectory: File, compilationSuccessful: Boolean) {
|
||||
removedSourceFiles.forEach { packagePartMap.remove(it) }
|
||||
|
||||
inlineFunctionsMap.clearOutdated(outDirectory)
|
||||
constantsMap.clearOutdated(outDirectory)
|
||||
protoMap.clearOutdated(outDirectory)
|
||||
if (compilationSuccessful) {
|
||||
inlineFunctionsMap.clearOutdated(outDirectory)
|
||||
constantsMap.clearOutdated(outDirectory)
|
||||
protoMap.clearOutdated(outDirectory)
|
||||
}
|
||||
}
|
||||
|
||||
public override fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
||||
|
||||
Reference in New Issue
Block a user