Minor: get rid of KotlinBuilder.ChangesProcessor

Original commit: 3ce84d04e6
This commit is contained in:
Zalim Bashorov
2015-11-06 18:09:45 +03:00
parent ba12afbbb9
commit 98bfb09cc0
@@ -214,22 +214,28 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
}
val caches = filesToCompile.keySet().map { incrementalCaches[it]!! }
val marker = ChangesProcessor(context, chunk, allCompiledFiles, caches)
marker.processChanges(changesInfo)
processChanges(context, chunk, allCompiledFiles, caches, changesInfo)
return ADDITIONAL_PASS_REQUIRED
}
class ChangesProcessor(
val context: CompileContext,
val chunk: ModuleChunk,
val allCompiledFiles: MutableSet<File>,
val caches: List<IncrementalCacheImpl>
fun processChanges(
context: CompileContext,
chunk: ModuleChunk,
allCompiledFiles: MutableSet<File>,
caches: List<IncrementalCacheImpl>,
changesInfo: ChangesInfo
) {
fun processChanges(changesInfo: ChangesInfo) {
changesInfo.doProcessChanges()
fun recompileInlined() {
for (cache in caches) {
val filesToReinline = cache.getFilesToReinline()
filesToReinline.forEach {
FSOperations.markDirty(context, CompilationRound.NEXT, it)
}
}
}
private fun ChangesInfo.doProcessChanges() {
fun ChangesInfo.doProcessChanges() {
fun isKotlin(file: File) = KotlinSourceFileCollector.isKotlinSourceFile(file)
fun isNotCompiled(file: File) = file !in allCompiledFiles
@@ -253,15 +259,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
}
}
private fun recompileInlined() {
for (cache in caches) {
val filesToReinline = cache.getFilesToReinline()
filesToReinline.forEach {
FSOperations.markDirty(context, CompilationRound.NEXT, it)
}
}
}
changesInfo.doProcessChanges()
}
private fun doCompileModuleChunk(