aboutsummaryrefslogtreecommitdiff
path: root/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-01-19 04:10:57 +0100
committerGitHub <noreply@github.com>2023-01-19 04:10:57 +0100
commit5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1 (patch)
treebb62ab50a59cbeca06de6fd1eb5c75ff27bc5bd0 /examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts
parent1fa8552994fb292729eca8c0de6a1561380b008c (diff)
downloaddokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.tar.gz
dokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.tar.bz2
dokka-5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1.zip
Revise README documentation for examples and plugins (#2736)
Diffstat (limited to 'examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts')
-rw-r--r--examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts38
1 files changed, 22 insertions, 16 deletions
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<DokkaMultiModuleTask>("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<VersioningPlugin, VersioningConfiguration> {
+ version = currentVersion
+ olderVersionsDir = file(previousVersionsDirectory)
+ }
}