Rename AdditionalCompilerArguments->CompilationOptions
This commit is contained in:
+3
-3
@@ -19,13 +19,13 @@ package org.jetbrains.kotlin.daemon.common
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
open class AdditionalCompilerArguments(val reportingFilters: List<ReportingFilter>) : Serializable {
|
open class CompilationOptions(val reportingFilters: List<ReportingFilter>) : Serializable {
|
||||||
companion object {
|
companion object {
|
||||||
const val serialVersionUID: Long = 0
|
const val serialVersionUID: Long = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class IncrementalCompilerArguments(
|
class IncrementalCompilationOptions(
|
||||||
val areFileChangesKnown: Boolean,
|
val areFileChangesKnown: Boolean,
|
||||||
val modifiedFiles: List<File>?,
|
val modifiedFiles: List<File>?,
|
||||||
val deletedFiles: List<File>?,
|
val deletedFiles: List<File>?,
|
||||||
@@ -33,7 +33,7 @@ class IncrementalCompilerArguments(
|
|||||||
val customCacheVersionFileName: String,
|
val customCacheVersionFileName: String,
|
||||||
val customCacheVersion: Int,
|
val customCacheVersion: Int,
|
||||||
reportingFilters: List<ReportingFilter>
|
reportingFilters: List<ReportingFilter>
|
||||||
) : AdditionalCompilerArguments(reportingFilters) {
|
) : CompilationOptions(reportingFilters) {
|
||||||
companion object {
|
companion object {
|
||||||
const val serialVersionUID: Long = 0
|
const val serialVersionUID: Long = 0
|
||||||
}
|
}
|
||||||
+1
-1
@@ -139,7 +139,7 @@ interface CompileService : Remote {
|
|||||||
compilerMode: CompilerMode,
|
compilerMode: CompilerMode,
|
||||||
targetPlatform: TargetPlatform,
|
targetPlatform: TargetPlatform,
|
||||||
compilerArguments: CommonCompilerArguments,
|
compilerArguments: CommonCompilerArguments,
|
||||||
additionalCompilerArguments: AdditionalCompilerArguments,
|
compilationOptions: CompilationOptions,
|
||||||
servicesFacade: CompilerServicesFacadeBase
|
servicesFacade: CompilerServicesFacadeBase
|
||||||
): CallResult<Int>
|
): CallResult<Int>
|
||||||
|
|
||||||
|
|||||||
@@ -326,11 +326,11 @@ class CompileServiceImpl(
|
|||||||
compilerMode: CompileService.CompilerMode,
|
compilerMode: CompileService.CompilerMode,
|
||||||
targetPlatform: CompileService.TargetPlatform,
|
targetPlatform: CompileService.TargetPlatform,
|
||||||
compilerArguments: CommonCompilerArguments,
|
compilerArguments: CommonCompilerArguments,
|
||||||
additionalCompilerArguments: AdditionalCompilerArguments,
|
compilationOptions: CompilationOptions,
|
||||||
servicesFacade: CompilerServicesFacadeBase
|
servicesFacade: CompilerServicesFacadeBase
|
||||||
): CompileService.CallResult<Int> {
|
): CompileService.CallResult<Int> {
|
||||||
val messageCollector = CompileServicesFacadeMessageCollector(servicesFacade, additionalCompilerArguments)
|
val messageCollector = CompileServicesFacadeMessageCollector(servicesFacade, compilationOptions)
|
||||||
val serviceReporter = CompileServiceReporterImpl(servicesFacade, additionalCompilerArguments)
|
val serviceReporter = CompileServiceReporterImpl(servicesFacade, compilationOptions)
|
||||||
|
|
||||||
return when (compilerMode) {
|
return when (compilerMode) {
|
||||||
CompileService.CompilerMode.JPS_COMPILER -> {
|
CompileService.CompilerMode.JPS_COMPILER -> {
|
||||||
@@ -352,7 +352,7 @@ class CompileServiceImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val k2jvmArgs = compilerArguments as K2JVMCompilerArguments
|
val k2jvmArgs = compilerArguments as K2JVMCompilerArguments
|
||||||
val gradleIncrementalArgs = additionalCompilerArguments as IncrementalCompilerArguments
|
val gradleIncrementalArgs = compilationOptions as IncrementalCompilationOptions
|
||||||
val gradleIncrementalServicesFacade = servicesFacade as IncrementalCompilerServicesFacade
|
val gradleIncrementalServicesFacade = servicesFacade as IncrementalCompilerServicesFacade
|
||||||
|
|
||||||
withIC {
|
withIC {
|
||||||
@@ -386,7 +386,7 @@ class CompileServiceImpl(
|
|||||||
|
|
||||||
private fun execIncrementalCompiler(
|
private fun execIncrementalCompiler(
|
||||||
k2jvmArgs: K2JVMCompilerArguments,
|
k2jvmArgs: K2JVMCompilerArguments,
|
||||||
incrementalCompilerArgs: IncrementalCompilerArguments,
|
incrementalCompilerArgs: IncrementalCompilationOptions,
|
||||||
servicesFacade: IncrementalCompilerServicesFacade,
|
servicesFacade: IncrementalCompilerServicesFacade,
|
||||||
messageCollector: CompileServicesFacadeMessageCollector
|
messageCollector: CompileServicesFacadeMessageCollector
|
||||||
): ExitCode {
|
): ExitCode {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.daemon.incremental
|
|||||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||||
import org.jetbrains.kotlin.daemon.report.FilteringReporterBase
|
import org.jetbrains.kotlin.daemon.report.FilteringReporterBase
|
||||||
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
||||||
import org.jetbrains.kotlin.daemon.common.AdditionalCompilerArguments
|
import org.jetbrains.kotlin.daemon.common.CompilationOptions
|
||||||
import org.jetbrains.kotlin.daemon.common.IncrementalCompilationServicesFacade
|
import org.jetbrains.kotlin.daemon.common.IncrementalCompilationServicesFacade
|
||||||
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
||||||
import org.jetbrains.kotlin.daemon.incremental.IncrementalCompilationSeverity.COMPILED_FILES
|
import org.jetbrains.kotlin.daemon.incremental.IncrementalCompilationSeverity.COMPILED_FILES
|
||||||
@@ -30,7 +30,7 @@ import java.io.Serializable
|
|||||||
|
|
||||||
internal class RemoteICReporter(
|
internal class RemoteICReporter(
|
||||||
servicesFacade: CompilerServicesFacadeBase,
|
servicesFacade: CompilerServicesFacadeBase,
|
||||||
additionalCompilerArgs: AdditionalCompilerArguments
|
additionalCompilerArgs: CompilationOptions
|
||||||
) : FilteringReporterBase(servicesFacade, additionalCompilerArgs, ReportCategory.INCREMENTAL_COMPILATION), ICReporter {
|
) : FilteringReporterBase(servicesFacade, additionalCompilerArgs, ReportCategory.INCREMENTAL_COMPILATION), ICReporter {
|
||||||
override fun report(message: () -> String) {
|
override fun report(message: () -> String) {
|
||||||
if (shouldReport(LOGGING.value)) {
|
if (shouldReport(LOGGING.value)) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.daemon.report
|
package org.jetbrains.kotlin.daemon.report
|
||||||
|
|
||||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||||
import org.jetbrains.kotlin.daemon.common.AdditionalCompilerArguments
|
import org.jetbrains.kotlin.daemon.common.CompilationOptions
|
||||||
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
||||||
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
||||||
import org.jetbrains.kotlin.daemon.report.FilteringReporterBase
|
import org.jetbrains.kotlin.daemon.report.FilteringReporterBase
|
||||||
@@ -40,8 +40,8 @@ internal class CompileServiceReporterStreamAdapter(private val out: PrintStream)
|
|||||||
|
|
||||||
internal class CompileServiceReporterImpl(
|
internal class CompileServiceReporterImpl(
|
||||||
servicesFacade: CompilerServicesFacadeBase,
|
servicesFacade: CompilerServicesFacadeBase,
|
||||||
additionalCompilerArguments: AdditionalCompilerArguments
|
compilationOptions: CompilationOptions
|
||||||
) : FilteringReporterBase(servicesFacade, additionalCompilerArguments, ReportCategory.DAEMON_MESSAGE), CompileServiceReporter {
|
) : FilteringReporterBase(servicesFacade, compilationOptions, ReportCategory.DAEMON_MESSAGE), CompileServiceReporter {
|
||||||
|
|
||||||
override fun report(severity: CompilerMessageSeverity, message: String) {
|
override fun report(severity: CompilerMessageSeverity, message: String) {
|
||||||
report(severity.value, message)
|
report(severity.value, message)
|
||||||
|
|||||||
+3
-3
@@ -19,16 +19,16 @@ package org.jetbrains.kotlin.daemon.report
|
|||||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||||
import org.jetbrains.kotlin.daemon.common.AdditionalCompilerArguments
|
import org.jetbrains.kotlin.daemon.common.CompilationOptions
|
||||||
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
||||||
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
||||||
|
|
||||||
internal class CompileServicesFacadeMessageCollector(
|
internal class CompileServicesFacadeMessageCollector(
|
||||||
private val servicesFacade: CompilerServicesFacadeBase,
|
private val servicesFacade: CompilerServicesFacadeBase,
|
||||||
additionalCompilerArguments: AdditionalCompilerArguments
|
compilationOptions: CompilationOptions
|
||||||
) : MessageCollector {
|
) : MessageCollector {
|
||||||
private var hasErrors = false
|
private var hasErrors = false
|
||||||
private val reportingFilter = additionalCompilerArguments.reportingFilters.firstOrNull { it.category == ReportCategory.DAEMON_MESSAGE }
|
private val reportingFilter = compilationOptions.reportingFilters.firstOrNull { it.category == ReportCategory.DAEMON_MESSAGE }
|
||||||
|
|
||||||
override fun clear() {
|
override fun clear() {
|
||||||
hasErrors = false
|
hasErrors = false
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.daemon.report
|
package org.jetbrains.kotlin.daemon.report
|
||||||
|
|
||||||
import org.jetbrains.kotlin.daemon.common.AdditionalCompilerArguments
|
import org.jetbrains.kotlin.daemon.common.CompilationOptions
|
||||||
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
import org.jetbrains.kotlin.daemon.common.CompilerServicesFacadeBase
|
||||||
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
import org.jetbrains.kotlin.daemon.common.ReportCategory
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
internal open class FilteringReporterBase(
|
internal open class FilteringReporterBase(
|
||||||
private val servicesFacade: CompilerServicesFacadeBase,
|
private val servicesFacade: CompilerServicesFacadeBase,
|
||||||
additionalCompilerArgs: AdditionalCompilerArguments,
|
additionalCompilerArgs: CompilationOptions,
|
||||||
private val reportCategory: ReportCategory
|
private val reportCategory: ReportCategory
|
||||||
) {
|
) {
|
||||||
private val reportingFilter = additionalCompilerArgs.reportingFilters.firstOrNull { it.category == reportCategory }
|
private val reportingFilter = additionalCompilerArgs.reportingFilters.firstOrNull { it.category == reportCategory }
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class JpsKotlinCompilerRunner : KotlinCompilerRunner<JpsCompilerEnvironment>() {
|
|||||||
CompileService.CompilerMode.JPS_COMPILER,
|
CompileService.CompilerMode.JPS_COMPILER,
|
||||||
targetPlatform,
|
targetPlatform,
|
||||||
compilerArgs,
|
compilerArgs,
|
||||||
AdditionalCompilerArguments(reportingFilters = getReportingFilters(compilerArgs.verbose)),
|
CompilationOptions(reportingFilters = getReportingFilters(compilerArgs.verbose)),
|
||||||
JpsCompilerServicesFacadeImpl(environment))
|
JpsCompilerServicesFacadeImpl(environment))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -169,7 +169,7 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
|
|||||||
CompileService.CompilerMode.NON_INCREMENTAL_COMPILER,
|
CompileService.CompilerMode.NON_INCREMENTAL_COMPILER,
|
||||||
targetPlatform,
|
targetPlatform,
|
||||||
environment.compilerArgs,
|
environment.compilerArgs,
|
||||||
AdditionalCompilerArguments(reportingFilters = getNonIncrementalReportingFilters(environment.compilerArgs.verbose)),
|
CompilationOptions(reportingFilters = getNonIncrementalReportingFilters(environment.compilerArgs.verbose)),
|
||||||
GradleCompilerServicesFacadeImpl(project, environment.messageCollector))
|
GradleCompilerServicesFacadeImpl(project, environment.messageCollector))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
|
|||||||
private fun incrementalCompilationWithDaemon(environment: GradleIncrementalCompilerEnvironment): ExitCode? {
|
private fun incrementalCompilationWithDaemon(environment: GradleIncrementalCompilerEnvironment): ExitCode? {
|
||||||
val knownChangedFiles = environment.changedFiles as? ChangedFiles.Known
|
val knownChangedFiles = environment.changedFiles as? ChangedFiles.Known
|
||||||
|
|
||||||
val additionalCompilerArguments = IncrementalCompilerArguments(
|
val additionalCompilerArguments = IncrementalCompilationOptions(
|
||||||
areFileChangesKnown = knownChangedFiles != null,
|
areFileChangesKnown = knownChangedFiles != null,
|
||||||
modifiedFiles = knownChangedFiles?.modified,
|
modifiedFiles = knownChangedFiles?.modified,
|
||||||
deletedFiles = knownChangedFiles?.removed,
|
deletedFiles = knownChangedFiles?.removed,
|
||||||
|
|||||||
Reference in New Issue
Block a user