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.Remote
import java.rmi.RemoteException import java.rmi.RemoteException
interface CompilationResultsSink : Remote { interface CompilationResults : Remote {
@Throws(RemoteException::class) @Throws(RemoteException::class)
fun push(compilationResultCategory: Int, value: Serializable) fun add(compilationResultCategory: Int, value: Serializable)
} }
enum class CompilationResultCategory(val code: Int) { enum class CompilationResultCategory(val code: Int) {
@@ -135,7 +135,7 @@ interface CompileService : Remote {
compilerArguments: Array<String>, compilerArguments: Array<String>,
compilationOptions: CompilationOptions, compilationOptions: CompilationOptions,
servicesFacade: CompilerServicesFacadeBase, servicesFacade: CompilerServicesFacadeBase,
compilationResultsSink: CompilationResultsSink? compilationResults: CompilationResults?
): CallResult<Int> ): CallResult<Int>
@Throws(RemoteException::class) @Throws(RemoteException::class)
@@ -319,7 +319,7 @@ class CompileServiceImpl(
compilerArguments: Array<String>, compilerArguments: Array<String>,
compilationOptions: CompilationOptions, compilationOptions: CompilationOptions,
servicesFacade: CompilerServicesFacadeBase, servicesFacade: CompilerServicesFacadeBase,
compilationResultsSink: CompilationResultsSink? compilationResults: CompilationResults?
): CompileService.CallResult<Int> { ): CompileService.CallResult<Int> {
val messageCollector = CompileServicesFacadeMessageCollector(servicesFacade, compilationOptions) val messageCollector = CompileServicesFacadeMessageCollector(servicesFacade, compilationOptions)
val daemonReporter = DaemonMessageReporter(servicesFacade, compilationOptions) val daemonReporter = DaemonMessageReporter(servicesFacade, compilationOptions)
@@ -362,7 +362,7 @@ class CompileServiceImpl(
withIC { withIC {
doCompile(sessionId, daemonReporter, tracer = null) { eventManger, profiler -> doCompile(sessionId, daemonReporter, tracer = null) { eventManger, profiler ->
execIncrementalCompiler(k2jvmArgs, gradleIncrementalArgs, gradleIncrementalServicesFacade, compilationResultsSink!!, execIncrementalCompiler(k2jvmArgs, gradleIncrementalArgs, gradleIncrementalServicesFacade, compilationResults!!,
messageCollector, daemonReporter) messageCollector, daemonReporter)
} }
} }
@@ -394,11 +394,11 @@ class CompileServiceImpl(
k2jvmArgs: K2JVMCompilerArguments, k2jvmArgs: K2JVMCompilerArguments,
incrementalCompilationOptions: IncrementalCompilationOptions, incrementalCompilationOptions: IncrementalCompilationOptions,
servicesFacade: IncrementalCompilerServicesFacade, servicesFacade: IncrementalCompilerServicesFacade,
compilationResultsSink: CompilationResultsSink, compilationResults: CompilationResults,
compilerMessageCollector: MessageCollector, compilerMessageCollector: MessageCollector,
daemonMessageReporter: DaemonMessageReporter daemonMessageReporter: DaemonMessageReporter
): ExitCode { ): ExitCode {
val reporter = RemoteICReporter(servicesFacade, compilationResultsSink, incrementalCompilationOptions) val reporter = RemoteICReporter(servicesFacade, compilationResults, incrementalCompilationOptions)
val annotationFileUpdater = if (servicesFacade.hasAnnotationsFileUpdater()) RemoteAnnotationsFileUpdater(servicesFacade) else null val annotationFileUpdater = if (servicesFacade.hasAnnotationsFileUpdater()) RemoteAnnotationsFileUpdater(servicesFacade) else null
val moduleFile = k2jvmArgs.module?.let(::File) val moduleFile = k2jvmArgs.module?.let(::File)
@@ -24,7 +24,7 @@ import java.io.Serializable
internal class RemoteICReporter( internal class RemoteICReporter(
private val servicesFacade: CompilerServicesFacadeBase, private val servicesFacade: CompilerServicesFacadeBase,
private val compilationResultsSink: CompilationResultsSink, private val compilationResults: CompilationResults,
compilationOptions: CompilationOptions compilationOptions: CompilationOptions
) : ICReporter { ) : ICReporter {
private val shouldReportMessages = ReportCategory.IC_MESSAGE.code in compilationOptions.reportCategories 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) { override fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {
if (shouldReportCompileIteration) { 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.gradle.api.Project
import org.jetbrains.kotlin.daemon.common.CompilationResultCategory 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.common.SOCKET_ANY_FREE_PORT
import org.jetbrains.kotlin.daemon.report.CompileIterationResult import org.jetbrains.kotlin.daemon.report.CompileIterationResult
import org.jetbrains.kotlin.gradle.plugin.kotlinDebug import org.jetbrains.kotlin.gradle.plugin.kotlinDebug
@@ -11,12 +11,12 @@ import java.io.Serializable
import java.rmi.RemoteException import java.rmi.RemoteException
import java.rmi.server.UnicastRemoteObject 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 log = project.logger
private val projectRootFile = project.rootProject.projectDir private val projectRootFile = project.rootProject.projectDir
@Throws(RemoteException::class) @Throws(RemoteException::class)
override fun push(compilationResultCategory: Int, value: Serializable) { override fun add(compilationResultCategory: Int, value: Serializable) {
if (compilationResultCategory == CompilationResultCategory.IC_COMPILE_ITERATION.code) { if (compilationResultCategory == CompilationResultCategory.IC_COMPILE_ITERATION.code) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
val compileIterationResult = value as? CompileIterationResult 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 res = withDaemon(environment, retryOnConnectionError = true) { daemon, sessionId ->
val argsArray = ArgumentUtils.convertArgumentsToStringList(environment.compilerArgs).toTypedArray() 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) } 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 res = withDaemon(environment, retryOnConnectionError = true) { daemon, sessionId ->
val argsArray = ArgumentUtils.convertArgumentsToStringList(environment.compilerArgs).toTypedArray() 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) } val exitCode = res?.get()?.let { exitCodeFromProcessExitCode(it) }