From 5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Thu, 19 Jan 2023 04:10:57 +0100 Subject: Revise README documentation for examples and plugins (#2736) --- .../parentProject/build.gradle.kts | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts') diff --git a/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts b/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts index dc909192..8387d9c8 100644 --- a/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts +++ b/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts @@ -1,25 +1,31 @@ import org.jetbrains.dokka.gradle.DokkaMultiModuleTask +import org.jetbrains.dokka.versioning.VersioningPlugin +import org.jetbrains.dokka.versioning.VersioningConfiguration + +buildscript { + dependencies { + classpath("org.jetbrains.dokka:versioning-plugin:1.7.20") + } + + repositories { + mavenCentral() + } +} dependencies { implementation(kotlin("stdlib")) } -val olderVersionsFolder = "olderVersions" - -// The previously documentations should be generated with the versioning plugin -val generatePreviouslyDocTask by tasks.register("dokkaPreviouslyDocumentation") { - dependencies { - dokkaPlugin("org.jetbrains.dokka:all-modules-page-plugin:1.7.20") - dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.7.20") - } - 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") -} +val currentVersion = "1.0" +val previousVersionsDirectory = project.rootProject.projectDir.resolve("previousDocVersions").invariantSeparatorsPath +// Main configuration for the versioning plugin. It will generate documentation for +// the current version of the application, and look for previous versions of docs +// in the directory defined in previousVersionsDirectory, allowing it to create +// the version navigation dropdown menu. tasks.dokkaHtmlMultiModule { - dependsOn(generatePreviouslyDocTask) - val configuredVersion = "1.0" - pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.versioning.VersioningPlugin" to """{ "version": "$configuredVersion", "olderVersionsDir": "${projectDir.resolve(olderVersionsFolder).invariantSeparatorsPath}" }""")) + pluginConfiguration { + version = currentVersion + olderVersionsDir = file(previousVersionsDirectory) + } } -- cgit