aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/DokkaMultimoduleBootstrapImpl.kt
blob: 6825ce64b037c9e8598c809d888aeae0a63d7c0e (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
package org.jetbrains.dokka

import com.google.gson.Gson
import org.jetbrains.dokka.DokkaBootstrapImpl.DokkaProxyLogger
import org.jetbrains.dokka.utilities.DokkaLogger
import java.util.function.BiConsumer

class DokkaMultimoduleBootstrapImpl : DokkaBootstrap {

    private lateinit var generator: DokkaGenerator

    fun configure(logger: DokkaLogger, configuration: DokkaConfiguration) {
        generator = DokkaGenerator(configuration, logger)
    }

    override fun configure(logger: BiConsumer<String, String>, serializedConfigurationJSON: String) = configure(
        DokkaProxyLogger(logger),
        Gson().fromJson(serializedConfigurationJSON, DokkaConfigurationImpl::class.java)
    )

    override fun generate() {
        generator.generateAllModulesPage()
    }

}