Extract LookupTracker service from IncrementalCompilationComponents

We don't need a `TargetId` to `IncrementalCache` mapping in JS
This commit is contained in:
Alexey Tsvetkov
2017-07-31 14:28:59 +03:00
parent a4c7dbd693
commit bb2fab5b5d
11 changed files with 28 additions and 24 deletions
@@ -39,6 +39,7 @@ import org.jetbrains.kotlin.compiler.plugin.CliOptionProcessingException
import org.jetbrains.kotlin.compiler.plugin.PluginCliOptionProcessingException
import org.jetbrains.kotlin.compiler.plugin.cliPluginUsageString
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.javac.JavacWrapper
import org.jetbrains.kotlin.load.java.JvmAbi
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
@@ -288,9 +289,12 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
configuration: CompilerConfiguration, arguments: K2JVMCompilerArguments, services: Services
) {
if (IncrementalCompilation.isEnabled()) {
val components = services.get(IncrementalCompilationComponents::class.java)
if (components != null) {
configuration.put(JVMConfigurationKeys.INCREMENTAL_COMPILATION_COMPONENTS, components)
services.get(LookupTracker::class.java)?.let {
configuration.put(CommonConfigurationKeys.LOOKUP_TRACKER, it)
}
services.get(IncrementalCompilationComponents::class.java)?.let {
configuration.put(JVMConfigurationKeys.INCREMENTAL_COMPILATION_COMPONENTS, it)
}
}
@@ -131,7 +131,7 @@ object TopDownAnalyzerFacadeForJVM {
val module = moduleContext.module
val incrementalComponents = configuration.get(JVMConfigurationKeys.INCREMENTAL_COMPILATION_COMPONENTS)
val lookupTracker = incrementalComponents?.getLookupTracker() ?: LookupTracker.DO_NOTHING
val lookupTracker = configuration.get(CommonConfigurationKeys.LOOKUP_TRACKER) ?: LookupTracker.DO_NOTHING
val targetIds = configuration.get(JVMConfigurationKeys.MODULES)?.map(::TargetId)
val separateModules = !configuration.getBoolean(JVMConfigurationKeys.USE_SINGLE_MODULE)