aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/DokkaBootstrapImpl.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-12-06 16:05:01 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-12-06 16:05:01 +0300
commit546e8edfd95c16665319bc371c6ccf63706ad1e4 (patch)
tree1db397a9efc5545c1e27db3fc2d920cfab35550a /core/src/main/kotlin/DokkaBootstrapImpl.kt
parent13bda7371cc60beaa4cc8302239efd21695b9e1f (diff)
downloaddokka-546e8edfd95c16665319bc371c6ccf63706ad1e4.tar.gz
dokka-546e8edfd95c16665319bc371c6ccf63706ad1e4.tar.bz2
dokka-546e8edfd95c16665319bc371c6ccf63706ad1e4.zip
Post-review changes, simplified proxies
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,