From 524749f6f36111a8fa77b3046b37387f76d87204 Mon Sep 17 00:00:00 2001 From: Leonid Stashevsky Date: Tue, 5 Apr 2022 10:14:40 +0200 Subject: [PATCH] Fix dokka version catalog generation --- build.gradle.kts | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fd89566b8d9..777cbd2586f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 } @@ -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 { - 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 { + 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 { rootProject.the().ignoreScripts = false }