Refactor JPS daemon client

This commit is contained in:
Alexey Tsvetkov
2017-01-10 23:50:33 +03:00
parent 73f7b76b5d
commit 99c72b6dff
10 changed files with 188 additions and 76 deletions
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import java.rmi.server.UnicastRemoteObject
class CompilerCallbackServicesFacadeServer(
open class CompilerCallbackServicesFacadeServer(
val incrementalCompilationComponents: IncrementalCompilationComponents? = null,
val compilationCanceledStatus: CompilationCanceledStatus? = null,
port: Int = SOCKET_ANY_FREE_PORT
@@ -38,7 +38,8 @@ interface CompileService : Remote {
enum class CompilerMode : Serializable {
NON_INCREMENTAL_COMPILER,
INCREMENTAL_COMPILER
INCREMENTAL_COMPILER,
JPS_COMPILER
}
companion object {
@@ -49,4 +49,6 @@ interface IncrementalCompilerServicesFacade : CompilerServicesFacadeBase {
@Throws(RemoteException::class)
fun getChanges(artifact: File, sinceTS: Long): Iterable<SimpleDirtyData>?
}
}
interface JpsCompilerServicesFacade : CompilerServicesFacadeBase, CompilerCallbackServicesFacade
@@ -334,6 +334,14 @@ class CompileServiceImpl(
val serviceReporter = CompileServiceReporterImpl(servicesFacade, additionalCompilerArguments)
return when (compilerMode) {
CompileService.CompilerMode.JPS_COMPILER -> {
val jpsServicesFacade = servicesFacade as JpsCompilerServicesFacade
doCompile(sessionId, serviceReporter, operationsTracer) { eventManger, profiler ->
val services = createCompileServices(jpsServicesFacade, eventManger, profiler)
execCompiler(targetPlatform, services, compilerArguments, messageCollector)
}
}
CompileService.CompilerMode.NON_INCREMENTAL_COMPILER -> {
doCompile(sessionId, serviceReporter, operationsTracer) { eventManger, profiler ->
execCompiler(targetPlatform, Services.EMPTY, compilerArguments, messageCollector)