Adrian Landborn
02/17/2025, 2:50 PMDokkaMultiModuleTask
. The reason being that we do release once per month (sometimes even more frequent) and the folders are piling up and and it takes longer and longer time to recompile/generate HTML for all old version. Maybe we are doing some things wrong? 🤔Adrian Landborn
02/17/2025, 2:52 PM// Dokka
val dokkaVersion: String by rootProject.extra
val currentVersion = evaluateVersionName()
val currentYear = Calendar.getInstance().get(Calendar.YEAR)
pluginManager.withPlugin("org.jetbrains.dokka") {
afterEvaluate {
val dokkaPlugin by configurations
dependencies {
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:$dokkaVersion")
dokkaPlugin("org.jetbrains.dokka:versioning-plugin:$dokkaVersion")
}
this.tasks.withType(DokkaMultiModuleTask::class) {
pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
version = currentVersion
olderVersionsDir = file("documentation/oldVersions")
renderVersionsNavigationOnAllPages = false
}
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customAssets = listOf(file("documentation/logo-icon.svg"))
footerMessage = "© X Systems 1999-$currentYear"
}
outputDirectory.set(file("documentation/html"))
includes.from("documentation/packages.md")
}
tasks.register("updateReadme", Exec::class) {
commandLine("./../../scripts/update_readme.sh")
}
// Always copy Readme.md before running Dokka generation.
tasks.findByName("dokkaHtmlPartial")?.dependsOn("updateReadme")
}
}
evant
02/17/2025, 11:37 PMAdrian Landborn
02/18/2025, 7:26 AMOleg Yukhnevich
02/18/2025, 11:28 AMIs there away to not recompile `olderVersionsDir`every timeDokka mostly just copies what is in older dir And yes, the output will be bigger and bigger, as currently it's only possible to include FULL HTML of previous versions inside the final bundle
Adrian Landborn
02/18/2025, 3:01 PMOleg Yukhnevich
02/18/2025, 3:27 PMAdrian Landborn
02/18/2025, 3:28 PMAdrian Landborn
02/18/2025, 3:29 PMOleg Yukhnevich
02/18/2025, 3:31 PMAdrian Landborn
02/18/2025, 3:33 PMAdrian Landborn
02/18/2025, 3:43 PMorg.gradle.parallel=true
we are not even using this.Adrian Landborn
02/18/2025, 3:43 PMOleg Yukhnevich
02/18/2025, 4:32 PMIf you are referring toNo, I'm about JVM cores limitation, f.e. like this (SO):
-XX:ActiveProcessorCount=2 # the value could be different
This could of course affect the performance, but that's probably why on GitHub runners, there are no issues - less cores and so less possibility to receive this specific deadlockAdrian Landborn
02/18/2025, 4:38 PMAdrian Landborn
02/18/2025, 4:40 PMOleg Yukhnevich
02/19/2025, 10:57 AMmore verbose modenope, there is nothing specific here which could help except for access to codebase and running checks with profiler/debugger to understand the root cause
Adrian Landborn
02/19/2025, 12:45 PMAdrian Landborn
02/20/2025, 9:32 AMAdrian Landborn
02/24/2025, 4:23 PMimport org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.versioning.VersioningConfiguration
import org.jetbrains.dokka.versioning.VersioningPlugin
/////
<code>
/////
pluginManager.withPlugin("org.jetbrains.dokka") {
afterEvaluate {
val dokkaPlugin by configurations
dependencies {
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:$dokkaVersion")
dokkaPlugin("org.jetbrains.dokka:versioning-plugin:$dokkaVersion")
}
this.tasks.withType(DokkaMultiModuleTask::class) {
pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
version = currentVersion
olderVersionsDir = file("documentation/oldVersions")
renderVersionsNavigationOnAllPages = false
}
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
customAssets = listOf(file("documentation/logo-icon.svg"))
footerMessage = "© Company 1999-$currentYear"
}
outputDirectory.set(file("documentation/html"))
includes.from("documentation/packages.md")
}
}
}
Adrian Landborn
02/24/2025, 4:56 PMthis.tasks.withType(DokkaMultiModuleTask::class)
How would you suggest me to proceed?Oleg Yukhnevich
02/26/2025, 1:33 PMit is pretty confusing and does not map at all to our setup.yeah, Gradle allows to much flexibility, and so it can be done in a million ways... Still, the final idea with convention plugins is the recommended way Dokka 2.0.0 with DGPv2
which has some modules that should be part of Dokka and some that are excludedwith DGPv2 you explicitly declare which projects will be aggregated, so you can just omit projects which should not be documented (here is how projects are included in an example)
Adrian Landborn
02/28/2025, 3:01 PMpluginsConfiguration.versioning {
olderVersionsDir.set(layout.projectDirectory.dir("documentation/oldVersions")) // Tying to access subProjects folders and fails bc the directory paths resolves incorrectly
}
Oleg Yukhnevich
02/28/2025, 3:08 PM"../documentation/oldVersions"
, or use other Gradle APIsAdrian Landborn
03/01/2025, 6:32 PMdependencies {
dokka(project(":foundation:"))
dokka(project(":design:"))
dokka(project(":icons:"))
}
pluginManager.withPlugin("org.jetbrains.dokka") {
dokka {
pluginsConfiguration.versioning {
olderVersionsDir.set(layout.projectDirectory.dir("documentation/oldVersions"))
}
}
}
allprojects {
repositories {
google()
mavenCentral()
maven("<https://jitpack.io>")
maven("<https://plugins.gradle.org/m2/>")
}
/* other code */
// Dokka
val dokkaVersion: String by rootProject.extra
val currentVersion = evaluateVersionName()
val currentYear = Calendar.getInstance().get(Calendar.YEAR)
pluginManager.withPlugin("org.jetbrains.dokka") {
dokka {
dokkaSourceSets.configureEach {
includes.from("$projectDir/README.md")
sourceLink {
basePublicationsDirectory
localDirectory.set(file("src/main/java"))
remoteUrl("<https://android.some-url.net/src>")
reportUndocumented.set(true)
skipEmptyPackages.set(true)
}
}
dokkaPublications.html {
outputDirectory.set(layout.projectDirectory.dir("documentation/html"))
includes.from("documentation/packages.md")
}
pluginsConfiguration.html {
customAssets.from("${rootProject.rootDir}/documentation/logo-icon.svg")
footerMessage.set("© Some company 1999-$currentYear")
}
pluginsConfiguration.versioning {
version = currentVersion
renderVersionsNavigationOnAllPages = false
}
}
}
}
solonovamax
03/04/2025, 4:27 PMmaven-metadata.xml
for a specific group-artifact pair, as in this file there is a list of every* single version for an artifact. (As an example, a project were being published to ca.solo-studios:slf4k:1.2.3
, then the maven-metadata.xml
could be downloaded from <https://repo1.maven.org/maven2/ca/solo-studios/slf4k/maven-metadata.xml>
)
The metadata would then be used to recursively download all the -javadoc
jars for a project before unpacking each of them into the directory for the previous versions.
*technically, it will not include every version. if -SNAPSHOT
versions are published, then it will only be listed once even though the same -SNAPSHOT
version can be re-published multiple times and gradle will publish it under the same directory with a new timestamp and an increasing number appended to the end (eg. you might publish ca/solo-studios/slf4k/0.5.4-SNAPSHOT/slf4k-0.5.4-20240922.223728-1.jar
and the next time you might publish ca/solo-studios/slf4k/0.5.4-SNAPSHOT/slf4k-0.5.4-20240922.224020-2.jar
. these would only be listed once, under 0.5.4-SNAPSHOT
.)Adrian Landborn
03/05/2025, 8:14 AMsolonovamax
03/05/2025, 4:59 PMolderVersionsDir
that can easily just be recreated bc it's already published to maven
I meant to say it back when the thread was originally posted but forgot toOleg Yukhnevich
03/05/2025, 5:07 PMpartial
outputs
so it's a bit harder then that 😞