aboutsummaryrefslogtreecommitdiff
path: root/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts
blob: afbc66754fe74518ff5f0ab8f3fbb66c75a30465 (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
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

dependencies {
    implementation(kotlin("stdlib"))
}

val olderVersionsFolder = "olderVersions"

// The previously documentations should be generated with the versioning plugin
val generatePreviouslyDocTask by tasks.register<DokkaMultiModuleTask>("dokkaPreviouslyDocumentation") {
    dependencies {
        dokkaPlugin("org.jetbrains.dokka:all-modules-page-plugin:1.7.10")
        dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.7.10")
    }
    val configuredVersion = "0.9"
    outputDirectory.set(file(projectDir.resolve(olderVersionsFolder).resolve(configuredVersion)))
    pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.versioning.VersioningPlugin" to """{ "version": "$configuredVersion" }"""))
    addChildTasks(listOf(project("childProjectA"), project("childProjectB")), "dokkaHtmlPartial")
}

tasks.dokkaHtmlMultiModule {
    dependsOn(generatePreviouslyDocTask)
    val configuredVersion = "1.0"
    pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.versioning.VersioningPlugin" to """{ "version": "$configuredVersion", "olderVersionsDir": "${projectDir.resolve(olderVersionsFolder).invariantSeparatorsPath}" }"""))
}