diff --git a/compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt b/compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt index 1cfd0b7f516..6e067f94f51 100644 --- a/compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt +++ b/compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt @@ -73,11 +73,11 @@ interface CompilerSelector { operator fun get(targetPlatform: CompileService.TargetPlatform): CLICompiler<*> } -interface EventManger { +interface EventManager { fun onCompilationFinished(f : () -> Unit) } -private class EventMangerImpl : EventManger { +private class EventManagerImpl : EventManager { private val onCompilationFinished = arrayListOf<() -> Unit>() override fun onCompilationFinished(f: () -> Unit) { @@ -659,12 +659,12 @@ class CompileServiceImpl( compilerMessagesStreamProxy: RemoteOutputStream, serviceOutputStreamProxy: RemoteOutputStream, operationsTracer: RemoteOperationsTracer?, - body: (PrintStream, EventManger, Profiler) -> ExitCode): CompileService.CallResult = + body: (PrintStream, EventManager, Profiler) -> ExitCode): CompileService.CallResult = ifAlive { withValidClientOrSessionProxy(sessionId) { session -> operationsTracer?.before("compile") val rpcProfiler = if (daemonOptions.reportPerf) WallAndThreadTotalProfiler() else DummyProfiler() - val eventManger = EventMangerImpl() + val eventManger = EventManagerImpl() val compilerMessagesStream = PrintStream(BufferedOutputStream(RemoteOutputStreamClient(compilerMessagesStreamProxy, rpcProfiler), REMOTE_STREAM_BUFFER_SIZE)) val serviceOutputStream = PrintStream(BufferedOutputStream(RemoteOutputStreamClient(serviceOutputStreamProxy, rpcProfiler), REMOTE_STREAM_BUFFER_SIZE)) try { @@ -689,12 +689,12 @@ class CompileServiceImpl( private fun doCompile(sessionId: Int, daemonMessageReporter: DaemonMessageReporter, tracer: RemoteOperationsTracer?, - body: (EventManger, Profiler) -> ExitCode): CompileService.CallResult = + body: (EventManager, Profiler) -> ExitCode): CompileService.CallResult = ifAlive { withValidClientOrSessionProxy(sessionId) { session -> tracer?.before("compile") val rpcProfiler = if (daemonOptions.reportPerf) WallAndThreadTotalProfiler() else DummyProfiler() - val eventManger = EventMangerImpl() + val eventManger = EventManagerImpl() try { val exitCode = checkedCompile(daemonMessageReporter, rpcProfiler) { body(eventManger, rpcProfiler).code @@ -708,10 +708,10 @@ class CompileServiceImpl( } } - private fun createCompileServices(facade: CompilerCallbackServicesFacade, eventManger: EventManger, rpcProfiler: Profiler): Services { + private fun createCompileServices(facade: CompilerCallbackServicesFacade, eventManager: EventManager, rpcProfiler: Profiler): Services { val builder = Services.Builder() if (facade.hasIncrementalCaches() || facade.hasLookupTracker()) { - builder.register(IncrementalCompilationComponents::class.java, RemoteIncrementalCompilationComponentsClient(facade, eventManger, rpcProfiler)) + builder.register(IncrementalCompilationComponents::class.java, RemoteIncrementalCompilationComponentsClient(facade, eventManager, rpcProfiler)) } if (facade.hasCompilationCanceledStatus()) { builder.register(CompilationCanceledStatus::class.java, RemoteCompilationCanceledStatusClient(facade, rpcProfiler)) diff --git a/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteIncrementalCompilationComponentsClient.kt b/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteIncrementalCompilationComponentsClient.kt index 8c4eaf78399..650578e769d 100644 --- a/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteIncrementalCompilationComponentsClient.kt +++ b/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteIncrementalCompilationComponentsClient.kt @@ -25,8 +25,8 @@ import org.jetbrains.kotlin.daemon.common.DummyProfiler import org.jetbrains.kotlin.daemon.common.Profiler -class RemoteIncrementalCompilationComponentsClient(val facade: CompilerCallbackServicesFacade, eventManger: EventManger, val profiler: Profiler = DummyProfiler()) : IncrementalCompilationComponents { - val remoteLookupTrackerClient = RemoteLookupTrackerClient(facade, eventManger, profiler) +class RemoteIncrementalCompilationComponentsClient(val facade: CompilerCallbackServicesFacade, eventManager: EventManager, val profiler: Profiler = DummyProfiler()) : IncrementalCompilationComponents { + val remoteLookupTrackerClient = RemoteLookupTrackerClient(facade, eventManager, profiler) override fun getIncrementalCache(target: TargetId): IncrementalCache = RemoteIncrementalCacheClient(facade, target, profiler) diff --git a/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteLookupTrackerClient.kt b/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteLookupTrackerClient.kt index a7967680bbb..444808d5f81 100644 --- a/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteLookupTrackerClient.kt +++ b/compiler/daemon/src/org/jetbrains/kotlin/daemon/RemoteLookupTrackerClient.kt @@ -26,7 +26,7 @@ import org.jetbrains.kotlin.incremental.components.Position import org.jetbrains.kotlin.incremental.components.ScopeKind -class RemoteLookupTrackerClient(val facade: CompilerCallbackServicesFacade, eventManger: EventManger, val profiler: Profiler = DummyProfiler()) : LookupTracker { +class RemoteLookupTrackerClient(val facade: CompilerCallbackServicesFacade, eventManager: EventManager, val profiler: Profiler = DummyProfiler()) : LookupTracker { private val isDoNothing = profiler.withMeasure(this) { facade.lookupTracker_isDoNothing() } private val lookups = hashSetOf() @@ -45,7 +45,7 @@ class RemoteLookupTrackerClient(val facade: CompilerCallbackServicesFacade, even } init { - eventManger.onCompilationFinished { flush() } + eventManager.onCompilationFinished { flush() } } private fun flush() {