blob: 114bade7d2c2b9f481e1c0aee8b11ce531fd3f26 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
package org.jetbrains.dokka
import org.jetbrains.dokka.utilities.DokkaLogger
import java.util.function.BiConsumer
/**
* Accessed with reflection
*/
@Suppress("unused")
class DokkaBootstrapImpl : DokkaBootstrap {
class DokkaProxyLogger(val consumer: BiConsumer<String, String>) : DokkaLogger {
override var warningsCount: Int = 0
override var errorsCount: Int = 0
override fun debug(message: String) {
consumer.accept("debug", message)
}
override fun info(message: String) {
consumer.accept("info", message)
}
override fun progress(message: String) {
consumer.accept("progress", message)
}
override fun warn(message: String) {
consumer.accept("warn", message).also { warningsCount++ }
}
override fun error(message: String) {
consumer.accept("error", message).also { errorsCount++ }
}
}
private lateinit var generator: DokkaGenerator
fun configure(logger: DokkaLogger, configuration: DokkaConfigurationImpl) {
generator = DokkaGenerator(configuration, logger)
}
override fun configure(serializedConfigurationJSON: String, logger: BiConsumer<String, String>) = configure(
DokkaProxyLogger(logger),
DokkaConfigurationImpl(serializedConfigurationJSON)
)
override fun generate() = generator.generate()
}
|