aboutsummaryrefslogtreecommitdiff
path: root/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts
diff options
context:
space:
mode:
authorvmishenev <vad-mishenev@yandex.ru>2021-11-23 20:01:23 +0300
committerGitHub <noreply@github.com>2021-11-23 20:01:23 +0300
commite24ef5d0b4915505eaa3b06999ab196eac463ea7 (patch)
treeecf2cca8a5094bf0a1c22310741dd09675704dde /examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts
parent8d151d1b5c99cded45bd8d60919b17f797e36116 (diff)
downloaddokka-e24ef5d0b4915505eaa3b06999ab196eac463ea7.tar.gz
dokka-e24ef5d0b4915505eaa3b06999ab196eac463ea7.tar.bz2
dokka-e24ef5d0b4915505eaa3b06999ab196eac463ea7.zip
Add sample project of versioning multi module (#2170)
* Add sample project of versioning multi module * Add sample task to generate previously docs * Update Gradle version * Update Kotlin version
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.kts25
1 files changed, 25 insertions, 0 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
new file mode 100644
index 00000000..3abd1ab3
--- /dev/null
+++ b/examples/gradle/dokka-versioning-multimodule-example/parentProject/build.gradle.kts
@@ -0,0 +1,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.6.0")
+ dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.6.0")
+ }
+ val configuredVersion = "0.9"
+ outputDirectory.set(file(projectDir.toPath().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/$olderVersionsFolder" }"""))
+} \ No newline at end of file