Update inline incremental compilation for compile daemon
This commit is contained in:
@@ -31,6 +31,7 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector;
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollectorUtil;
|
||||
import org.jetbrains.kotlin.config.CompilerSettings;
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache;
|
||||
import org.jetbrains.kotlin.modules.Module;
|
||||
import org.jetbrains.kotlin.rmi.*;
|
||||
import org.jetbrains.kotlin.rmi.kotlinr.KotlinCompilerClient;
|
||||
import org.jetbrains.kotlin.utils.UtilsPackage;
|
||||
@@ -58,7 +59,7 @@ public class KotlinCompilerRunner {
|
||||
CompilerSettings compilerSettings,
|
||||
MessageCollector messageCollector,
|
||||
CompilerEnvironment environment,
|
||||
Map<String, IncrementalCache> incrementalCaches,
|
||||
Map<Module, IncrementalCache> incrementalCaches,
|
||||
File moduleFile,
|
||||
OutputItemsCollector collector
|
||||
) {
|
||||
@@ -75,7 +76,7 @@ public class KotlinCompilerRunner {
|
||||
@NotNull CompilerSettings compilerSettings,
|
||||
@NotNull MessageCollector messageCollector,
|
||||
@NotNull CompilerEnvironment environment,
|
||||
Map<String, IncrementalCache> incrementalCaches,
|
||||
Map<Module, IncrementalCache> incrementalCaches,
|
||||
@NotNull OutputItemsCollector collector,
|
||||
@NotNull Collection<File> sourceFiles,
|
||||
@NotNull List<String> libraryFiles,
|
||||
@@ -95,7 +96,7 @@ public class KotlinCompilerRunner {
|
||||
MessageCollector messageCollector,
|
||||
OutputItemsCollector collector,
|
||||
CompilerEnvironment environment,
|
||||
Map<String, IncrementalCache> incrementalCaches
|
||||
Map<Module, IncrementalCache> incrementalCaches
|
||||
) {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
PrintStream out = new PrintStream(stream);
|
||||
@@ -116,7 +117,7 @@ public class KotlinCompilerRunner {
|
||||
CommonCompilerArguments arguments,
|
||||
String additionalArguments,
|
||||
CompilerEnvironment environment,
|
||||
Map<String, IncrementalCache> incrementalCaches,
|
||||
Map<Module, IncrementalCache> incrementalCaches,
|
||||
PrintStream out,
|
||||
MessageCollector messageCollector
|
||||
) {
|
||||
|
||||
@@ -62,6 +62,7 @@ import org.jetbrains.kotlin.load.kotlin.PackageClassUtils
|
||||
import org.jetbrains.kotlin.load.kotlin.header.isCompatiblePackageFacadeKind
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
|
||||
import org.jetbrains.kotlin.modules.Module
|
||||
import org.jetbrains.kotlin.progress.CompilationCanceledException
|
||||
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||
@@ -319,7 +320,8 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
}
|
||||
|
||||
return compileToJvm(allCompiledFiles, chunk, commonArguments, context, dirtyFilesHolder, environment,
|
||||
incrementalCaches.mapKeysTo(HashMap<String, IncrementalCache>(incrementalCaches.size()), { it.getKey().id }),
|
||||
incrementalCaches.mapKeysTo(HashMap<Module, IncrementalCache>(incrementalCaches.size()),
|
||||
{ ModuleToModuleBuildTargetAdapter(it.getKey()) }),
|
||||
filesToCompile, messageCollector)
|
||||
}
|
||||
|
||||
@@ -486,7 +488,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
private fun compileToJs(chunk: ModuleChunk,
|
||||
commonArguments: CommonCompilerArguments,
|
||||
environment: CompilerEnvironment,
|
||||
incrementalCaches: MutableMap<String, IncrementalCache>?,
|
||||
incrementalCaches: MutableMap<Module, IncrementalCache>?,
|
||||
messageCollector: MessageCollectorAdapter, project: JpsProject
|
||||
): OutputItemsCollectorImpl? {
|
||||
val outputItemCollector = OutputItemsCollectorImpl()
|
||||
@@ -541,7 +543,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
context: CompileContext,
|
||||
dirtyFilesHolder: DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget>,
|
||||
environment: CompilerEnvironment,
|
||||
incrementalCaches: MutableMap<String, IncrementalCache>?,
|
||||
incrementalCaches: MutableMap<Module, IncrementalCache>?,
|
||||
filesToCompile: MultiMap<ModuleBuildTarget, File>, messageCollector: MessageCollectorAdapter
|
||||
): OutputItemsCollectorImpl? {
|
||||
val outputItemCollector = OutputItemsCollectorImpl()
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class IncrementalCompilationComponentsImpl(
|
||||
override fun getLookupTracker(): LookupTracker = lookupTracker
|
||||
}
|
||||
|
||||
private class ModuleToModuleBuildTargetAdapter(
|
||||
public class ModuleToModuleBuildTargetAdapter(
|
||||
private val moduleBuildTarget: ModuleBuildTarget
|
||||
) : Module {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user