Minor: get rid of KotlinBuilder.ChangesProcessor
Original commit: 3ce84d04e6
This commit is contained in:
@@ -214,22 +214,28 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
|||||||
}
|
}
|
||||||
|
|
||||||
val caches = filesToCompile.keySet().map { incrementalCaches[it]!! }
|
val caches = filesToCompile.keySet().map { incrementalCaches[it]!! }
|
||||||
val marker = ChangesProcessor(context, chunk, allCompiledFiles, caches)
|
processChanges(context, chunk, allCompiledFiles, caches, changesInfo)
|
||||||
marker.processChanges(changesInfo)
|
|
||||||
return ADDITIONAL_PASS_REQUIRED
|
return ADDITIONAL_PASS_REQUIRED
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChangesProcessor(
|
fun processChanges(
|
||||||
val context: CompileContext,
|
context: CompileContext,
|
||||||
val chunk: ModuleChunk,
|
chunk: ModuleChunk,
|
||||||
val allCompiledFiles: MutableSet<File>,
|
allCompiledFiles: MutableSet<File>,
|
||||||
val caches: List<IncrementalCacheImpl>
|
caches: List<IncrementalCacheImpl>,
|
||||||
|
changesInfo: ChangesInfo
|
||||||
) {
|
) {
|
||||||
fun processChanges(changesInfo: ChangesInfo) {
|
fun recompileInlined() {
|
||||||
changesInfo.doProcessChanges()
|
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 isKotlin(file: File) = KotlinSourceFileCollector.isKotlinSourceFile(file)
|
||||||
fun isNotCompiled(file: File) = file !in allCompiledFiles
|
fun isNotCompiled(file: File) = file !in allCompiledFiles
|
||||||
|
|
||||||
@@ -253,15 +259,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun recompileInlined() {
|
changesInfo.doProcessChanges()
|
||||||
for (cache in caches) {
|
|
||||||
val filesToReinline = cache.getFilesToReinline()
|
|
||||||
|
|
||||||
filesToReinline.forEach {
|
|
||||||
FSOperations.markDirty(context, CompilationRound.NEXT, it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doCompileModuleChunk(
|
private fun doCompileModuleChunk(
|
||||||
|
|||||||
Reference in New Issue
Block a user