Skip to content

Commit

Permalink
Fix dokka version catalog generation
Browse files Browse the repository at this point in the history
  • Loading branch information
e5l committed Apr 8, 2022
1 parent 545d694 commit 524749f
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ val disabledExplicitApiModeProjects = listOf(
apply(from = "gradle/compatibility.gradle")

plugins {
id("org.jetbrains.dokka") version "1.6.10"
id("org.jetbrains.dokka") version "1.6.10" apply false
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.8.0"
id("kotlinx-atomicfu") version "0.17.1" apply false
}
Expand Down Expand Up @@ -176,21 +176,28 @@ subprojects {
println("Using Kotlin compiler version: ${org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION}")
filterSnapshotTests()

subprojects {
allprojects {
plugins.apply("org.jetbrains.dokka")
}

val docs: String? by extra
if (docs != null) {
tasks.withType<DokkaMultiModuleTask> {
val mapOf = mapOf(
"org.jetbrains.dokka.versioning.VersioningPlugin" to
"""{ "version": "$configuredVersion", "olderVersionsDir":"$docs" }"""
)
pluginsMapConfiguration.set(mapOf)
val dokkaPlugin by configurations
dependencies {
dokkaPlugin("org.jetbrains.dokka:all-modules-page-plugin:1.6.10")
dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.6.10")
}
}

val dokkaOutputDir = "../versions"

tasks.withType<DokkaMultiModuleTask> {
val mapOf = mapOf(
"org.jetbrains.dokka.versioning.VersioningPlugin" to
"""{ "version": "$configuredVersion", "olderVersionsDir":"$dokkaOutputDir" }"""
)

outputDirectory.set(file(projectDir.toPath().resolve(dokkaOutputDir).resolve(configuredVersion)))
pluginsMapConfiguration.set(mapOf)
}

rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().ignoreScripts = false
}

0 comments on commit 524749f

Please sign in to comment.