Make ICReporter interface
This commit is contained in:
@@ -19,14 +19,14 @@ package org.jetbrains.kotlin.incremental
|
|||||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
abstract class ICReporter {
|
interface ICReporter {
|
||||||
abstract fun report(message: ()->String)
|
fun report(message: ()->String)
|
||||||
|
|
||||||
// used in Gradle plugin
|
// used in Gradle plugin
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
open fun reportCompileIteration(sourceFiles: Iterable<File>, exitCode: ExitCode) {}
|
fun reportCompileIteration(sourceFiles: Iterable<File>, exitCode: ExitCode) {}
|
||||||
|
|
||||||
open fun pathsAsString(files: Iterable<File>): String =
|
fun pathsAsString(files: Iterable<File>): String =
|
||||||
files.map { it.canonicalPath }.joinToString()
|
files.map { it.canonicalPath }.joinToString()
|
||||||
|
|
||||||
fun pathsAsString(vararg files: File): String =
|
fun pathsAsString(vararg files: File): String =
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ fun makeIncrementally(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private object EmptyICReporter : ICReporter() {
|
private object EmptyICReporter : ICReporter {
|
||||||
override fun report(message: ()->String) {
|
override fun report(message: ()->String) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -124,7 +124,7 @@ class KotlinStandaloneIncrementalCompilationTest : TestWithWorkingDir() {
|
|||||||
val compiledSources = arrayListOf<File>()
|
val compiledSources = arrayListOf<File>()
|
||||||
var resultExitCode = ExitCode.OK
|
var resultExitCode = ExitCode.OK
|
||||||
|
|
||||||
val reporter = object : ICReporter() {
|
val reporter = object : ICReporter {
|
||||||
override fun report(message: ()->String) {
|
override fun report(message: ()->String) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -782,7 +782,7 @@ private fun CompilationResult.doProcessChanges(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class JpsICReporter : ICReporter() {
|
private class JpsICReporter : ICReporter {
|
||||||
override fun report(message: ()->String) {
|
override fun report(message: ()->String) {
|
||||||
if (KotlinBuilder.LOG.isDebugEnabled) {
|
if (KotlinBuilder.LOG.isDebugEnabled) {
|
||||||
KotlinBuilder.LOG.debug(message())
|
KotlinBuilder.LOG.debug(message())
|
||||||
|
|||||||
Reference in New Issue
Block a user