From 98bfb09cc03c531435a6edc452c4d5304609feaa Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Fri, 6 Nov 2015 18:09:45 +0300 Subject: [PATCH] Minor: get rid of KotlinBuilder.ChangesProcessor Original commit: 3ce84d04e6a9d455f14854f78f025e0f7013b028 --- .../kotlin/jps/build/KotlinBuilder.kt | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt index b863f64c767..c9863e67af5 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt @@ -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, - val caches: List + fun processChanges( + context: CompileContext, + chunk: ModuleChunk, + allCompiledFiles: MutableSet, + caches: List, + 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(