Move CompilerMode and TargetPlatform to CompilationOptions

This commit is contained in:
Alexey Tsvetkov
2017-01-10 19:49:26 +03:00
parent c5a5463f50
commit e44cc43ada
5 changed files with 28 additions and 30 deletions
@@ -19,7 +19,11 @@ package org.jetbrains.kotlin.daemon.common
import java.io.File
import java.io.Serializable
open class CompilationOptions(val reportingFilters: List<ReportingFilter>) : Serializable {
open class CompilationOptions(
val compilerMode: CompileService.CompilerMode,
val targetPlatform: CompileService.TargetPlatform,
val reportingFilters: List<ReportingFilter>
) : Serializable {
companion object {
const val serialVersionUID: Long = 0
}
@@ -32,8 +36,10 @@ class IncrementalCompilationOptions(
val workingDir: File,
val customCacheVersionFileName: String,
val customCacheVersion: Int,
compilerMode: CompileService.CompilerMode,
targetPlatform: CompileService.TargetPlatform,
reportingFilters: List<ReportingFilter>
) : CompilationOptions(reportingFilters) {
) : CompilationOptions(compilerMode, targetPlatform, reportingFilters) {
companion object {
const val serialVersionUID: Long = 0
}
@@ -136,8 +136,6 @@ interface CompileService : Remote {
@Throws(RemoteException::class)
fun compile(
sessionId: Int,
compilerMode: CompilerMode,
targetPlatform: TargetPlatform,
compilerArguments: CommonCompilerArguments,
compilationOptions: CompilationOptions,
servicesFacade: CompilerServicesFacadeBase
@@ -323,14 +323,14 @@ class CompileServiceImpl(
override fun compile(
sessionId: Int,
compilerMode: CompileService.CompilerMode,
targetPlatform: CompileService.TargetPlatform,
compilerArguments: CommonCompilerArguments,
compilationOptions: CompilationOptions,
servicesFacade: CompilerServicesFacadeBase
): CompileService.CallResult<Int> {
val messageCollector = CompileServicesFacadeMessageCollector(servicesFacade, compilationOptions)
val serviceReporter = CompileServiceReporterImpl(servicesFacade, compilationOptions)
val compilerMode = compilationOptions.compilerMode
val targetPlatform = compilationOptions.targetPlatform
return when (compilerMode) {
CompileService.CompilerMode.JPS_COMPILER -> {
@@ -338,7 +338,7 @@ class CompileServiceImpl(
doCompile(sessionId, serviceReporter, tracer = null) { eventManger, profiler ->
val services = createCompileServices(jpsServicesFacade, eventManger, profiler)
execCompiler(targetPlatform, services, compilerArguments, messageCollector)
execCompiler(compilationOptions.targetPlatform, services, compilerArguments, messageCollector)
}
}
CompileService.CompilerMode.NON_INCREMENTAL_COMPILER -> {