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

docs(versioning): adding dokka versioning plugin #335

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ buildscript {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
classpath("org.mozilla.rust-android-gradle:plugin:0.9.3")
classpath("com.android.tools.build:gradle:7.4.2")
classpath("org.jetbrains.dokka:versioning-plugin:1.9.10")
}
}

Expand All @@ -31,7 +32,7 @@ plugins {
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
id("org.jetbrains.kotlin.multiplatform") version "1.9.0" apply false
id("org.mozilla.rust-android-gradle.rust-android") version "0.9.3" apply false
id("org.jetbrains.dokka") version "1.8.20" apply false
id("org.jetbrains.dokka") version "1.9.10" apply false
id("com.adarshr.test-logger") version "3.2.0" apply false
kotlin("plugin.serialization") version "1.9.0" apply false
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
Expand Down
22 changes: 22 additions & 0 deletions zenoh-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
//

import com.nishtahir.CargoExtension
import org.jetbrains.dokka.versioning.VersioningConfiguration
import org.jetbrains.dokka.versioning.VersioningPlugin

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -285,3 +287,23 @@ fun Project.configureCargo() {
)
}
}

val dokkaPlugin by configurations
dependencies {
dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.9.10")
}

tasks.dokkaHtml {
val lastDocsVersionDirectory = project.rootProject.projectDir.resolve("docs")
val olderDocsVersionsDirectory = project.rootProject.projectDir.resolve("docs/older")

pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
renderVersionsNavigationOnAllPages = true
// Because we want to keep versioning for the documentation, we specify both the directory pointing to the last
// version of the documentation (under /docs) and the directories containing the older versions (under docs/older).
// This way running `gradle dokkaHtml` after upgrading the version of the repository will take into consideration
// those old versions, which will be accessible via a dropdown menu.
olderVersionsDir = file(olderDocsVersionsDirectory)
olderVersions = arrayListOf(file(lastDocsVersionDirectory))
}
}
Loading