Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sample project of versioning multi module #2170

Merged
merged 4 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +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")
vmishenev marked this conversation as resolved.
Show resolved Hide resolved
}

tasks.dokkaHtmlMultiModule {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think that it would be nice to have a task that depends on another 2 tasks which generate previous versions, so user can see how expected workflow looks like.

dependsOn(generatePreviouslyDocTask)
val configuredVersion = "1.0"
// The previously documentations should be generated with the versioning plugin
pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.versioning.VersioningPlugin" to """{ "version": "$configuredVersion", "olderVersionsDir": "$projectDir/olderVersions" }"""))
pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.versioning.VersioningPlugin" to """{ "version": "$configuredVersion", "olderVersionsDir": "$projectDir/$olderVersionsFolder" }"""))
}

This file was deleted.