aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/DokkaBootstrapImpl.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/DokkaBootstrapImpl.kt')
-rw-r--r--core/src/main/kotlin/DokkaBootstrapImpl.kt20
1 files changed, 17 insertions, 3 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt
index cbec4985..eb2b2a65 100644
--- a/core/src/main/kotlin/DokkaBootstrapImpl.kt
+++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt
@@ -1,6 +1,7 @@
package org.jetbrains.dokka
import java.io.File
+import java.util.function.BiConsumer
fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinition {
val (path, urlAndLine) = srcLink.split('=')
@@ -9,12 +10,25 @@ fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinition {
urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#" + it })
}
-
class DokkaBootstrapImpl : DokkaBootstrap {
+ class DokkaProxyLogger(val consumer: BiConsumer<String, String>) : DokkaLogger {
+ override fun info(message: String) {
+ consumer.accept("info", message)
+ }
+
+ override fun warn(message: String) {
+ consumer.accept("warn", message)
+ }
+
+ override fun error(message: String) {
+ consumer.accept("error", message)
+ }
+ }
+
lateinit var generator: DokkaGenerator
- override fun configure(logger: DokkaLogger,
+ override fun configure(logger: BiConsumer<String, String>,
moduleName: String,
classpath: List<String>,
sources: List<String>,
@@ -30,7 +44,7 @@ class DokkaBootstrapImpl : DokkaBootstrap {
generateIndexPages: Boolean,
sourceLinks: List<String>) {
generator = DokkaGenerator(
- logger,
+ DokkaProxyLogger(logger),
classpath,
sources,
samples,