Minor: rename CompilationResultSink->CompilationResults

This commit is contained in:
Alexey Tsvetkov
2017-01-13 13:06:05 +03:00
parent bdae0b5efb
commit 3d07c40887
6 changed files with 14 additions and 14 deletions
@@ -20,9 +20,9 @@ import java.io.Serializable
import java.rmi.Remote
import java.rmi.RemoteException
interface CompilationResultsSink : Remote {
interface CompilationResults : Remote {
@Throws(RemoteException::class)
fun push(compilationResultCategory: Int, value: Serializable)
fun add(compilationResultCategory: Int, value: Serializable)
}
enum class CompilationResultCategory(val code: Int) {
@@ -135,7 +135,7 @@ interface CompileService : Remote {
compilerArguments: Array<String>,
compilationOptions: CompilationOptions,
servicesFacade: CompilerServicesFacadeBase,
compilationResultsSink: CompilationResultsSink?
compilationResults: CompilationResults?
): CallResult<Int>
@Throws(RemoteException::class)
@@ -319,7 +319,7 @@ class CompileServiceImpl(
compilerArguments: Array<String>,
compilationOptions: CompilationOptions,
servicesFacade: CompilerServicesFacadeBase,
compilationResultsSink: CompilationResultsSink?
compilationResults: CompilationResults?
): CompileService.CallResult<Int> {
val messageCollector = CompileServicesFacadeMessageCollector(servicesFacade, compilationOptions)
val daemonReporter = DaemonMessageReporter(servicesFacade, compilationOptions)
@@ -362,7 +362,7 @@ class CompileServiceImpl(
withIC {
doCompile(sessionId, daemonReporter, tracer = null) { eventManger, profiler ->
execIncrementalCompiler(k2jvmArgs, gradleIncrementalArgs, gradleIncrementalServicesFacade, compilationResultsSink!!,
execIncrementalCompiler(k2jvmArgs, gradleIncrementalArgs, gradleIncrementalServicesFacade, compilationResults!!,
messageCollector, daemonReporter)
}
}
@@ -394,11 +394,11 @@ class CompileServiceImpl(
k2jvmArgs: K2JVMCompilerArguments,
incrementalCompilationOptions: IncrementalCompilationOptions,
servicesFacade: IncrementalCompilerServicesFacade,
compilationResultsSink: CompilationResultsSink,
compilationResults: CompilationResults,
compilerMessageCollector: MessageCollector,
daemonMessageReporter: DaemonMessageReporter
): ExitCode {
val reporter = RemoteICReporter(servicesFacade, compilationResultsSink, incrementalCompilationOptions)
val reporter = RemoteICReporter(servicesFacade, compilationResults, incrementalCompilationOptions)
val annotationFileUpdater = if (servicesFacade.hasAnnotationsFileUpdater()) RemoteAnnotationsFileUpdater(servicesFacade) else null
val moduleFile = k2jvmArgs.module?.let(::File)
@@ -24,7 +24,7 @@ import java.io.Serializable
internal class RemoteICReporter(
private val servicesFacade: CompilerServicesFacadeBase,
private val compilationResultsSink: CompilationResultsSink,
private val compilationResults: CompilationResults,
compilationOptions: CompilationOptions
) : ICReporter {
private val shouldReportMessages = ReportCategory.IC_MESSAGE.code in compilationOptions.reportCategories
@@ -39,7 +39,7 @@ internal class RemoteICReporter(
override fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {
if (shouldReportCompileIteration) {
compilationResultsSink.push(CompilationResultCategory.IC_COMPILE_ITERATION.code, CompileIterationResult(sourceFiles, exitCode.toString()))
compilationResults.add(CompilationResultCategory.IC_COMPILE_ITERATION.code, CompileIterationResult(sourceFiles, exitCode.toString()))
}
}
}
@@ -2,7 +2,7 @@ package org.jetbrains.kotlin.compilerRunner
import org.gradle.api.Project
import org.jetbrains.kotlin.daemon.common.CompilationResultCategory
import org.jetbrains.kotlin.daemon.common.CompilationResultsSink
import org.jetbrains.kotlin.daemon.common.CompilationResults
import org.jetbrains.kotlin.daemon.common.SOCKET_ANY_FREE_PORT
import org.jetbrains.kotlin.daemon.report.CompileIterationResult
import org.jetbrains.kotlin.gradle.plugin.kotlinDebug
@@ -11,12 +11,12 @@ import java.io.Serializable
import java.rmi.RemoteException
import java.rmi.server.UnicastRemoteObject
internal class GradleCompilationResultsSink(project: Project): CompilationResultsSink, UnicastRemoteObject(SOCKET_ANY_FREE_PORT) {
internal class GradleCompilationResults(project: Project): CompilationResults, UnicastRemoteObject(SOCKET_ANY_FREE_PORT) {
private val log = project.logger
private val projectRootFile = project.rootProject.projectDir
@Throws(RemoteException::class)
override fun push(compilationResultCategory: Int, value: Serializable) {
override fun add(compilationResultCategory: Int, value: Serializable) {
if (compilationResultCategory == CompilationResultCategory.IC_COMPILE_ITERATION.code) {
@Suppress("UNCHECKED_CAST")
val compileIterationResult = value as? CompileIterationResult
@@ -173,7 +173,7 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
val res = withDaemon(environment, retryOnConnectionError = true) { daemon, sessionId ->
val argsArray = ArgumentUtils.convertArgumentsToStringList(environment.compilerArgs).toTypedArray()
daemon.compile(sessionId, argsArray, compilationOptions, servicesFacade, compilationResultsSink = null)
daemon.compile(sessionId, argsArray, compilationOptions, servicesFacade, compilationResults = null)
}
val exitCode = res?.get()?.let { exitCodeFromProcessExitCode(it) }
@@ -205,7 +205,7 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
val res = withDaemon(environment, retryOnConnectionError = true) { daemon, sessionId ->
val argsArray = ArgumentUtils.convertArgumentsToStringList(environment.compilerArgs).toTypedArray()
daemon.compile(sessionId, argsArray, compilationOptions, servicesFacade, GradleCompilationResultsSink(project))
daemon.compile(sessionId, argsArray, compilationOptions, servicesFacade, GradleCompilationResults(project))
}
val exitCode = res?.get()?.let { exitCodeFromProcessExitCode(it) }