Sebastien Leclerc Lavallee
05/20/2025, 10:20 PMbuild.gradle.kts
:
subprojects {
apply("com.dokka...")
afterEvaluate {
dokka {
dokkaPublications.html {
moduleName.set("SOME - " + project.name)
includes.from(project.layout.projectDirectory.file("CHANGELOG.md"))
}
}
}
}
The file is at the correct location for each subproject, but I don't see my changelog file when I execute
./gradlew dokkaGenerate
Is there anything missing ?
Is that something that's possible?
Thanks! 🙂jw
05/20/2025, 11:00 PMproject.
is referencing the root, not the subprojectSebastien Leclerc Lavallee
05/20/2025, 11:04 PMjw
05/20/2025, 11:12 PMjw
05/20/2025, 11:13 PMjw
05/20/2025, 11:13 PMSebastien Leclerc Lavallee
05/21/2025, 12:39 AMafterEvaluate
because I wanted to have the project version which isn't available there because I read it from a file.
I tried both
includes.from(project.layout.projectDirectory.file("CHANGELOG.md"))
// or
includes.from("CHANGELOG.md")
but neither worked.
Do you know where / how it should show?Adam Semenenko
05/21/2025, 7:11 AMCHANGELOG.md
, or is there a single CHANGELOG.md
in the root project?Adam Semenenko
05/21/2025, 7:16 AMbecause I wanted to have the project version which isn't available thereCould you show how you want to use the project version? You could probably just wrap it in a provider to make it lazy, e.g.
provider { project.version.toString() }
afterEvaluate {}
is really delicate, so try to avoid it! Even if you have to use it, try to limit it as much as possible - don't put the whole dokka {}
block in there, only the part that should be lazy.Sebastien Leclerc Lavallee
05/21/2025, 1:34 PMafterEvaluate { }
but still no MD file showingAdam Semenenko
05/21/2025, 1:55 PMincludes
have to have a very specific format for Dokka to recognise them, just adding regular markdown files will be ignored.
https://github.com/Kotlin/dokka/blob/2ed83e5811057623ec16c36c66435fa300d3c9ca/dokka-runners/dokka-gradle-plugin/src/main/kotlin/formats/DokkaPublication.kt#L130-L134Sebastien Leclerc Lavallee
05/21/2025, 1:58 PMAdam Semenenko
05/21/2025, 2:00 PMAdam Semenenko
05/21/2025, 2:00 PM# Module <name-of-module>
at the start of the changelog (replacing <name-of-module>
with the actual Dokka module name)Sebastien Leclerc Lavallee
05/21/2025, 2:01 PMAdam Semenenko
05/21/2025, 2:01 PMSebastien Leclerc Lavallee
05/21/2025, 3:45 PMindex.html
?Adam Semenenko
05/21/2025, 3:50 PMmodule.md
file that's added to Dokka via includes()
, and the module.md
is formatted correctly, then yes, you should see something in index.htmlSebastien Leclerc Lavallee
05/21/2025, 4:10 PMTHING.md
file
subprojects {
dokka {
dokkaPublications.html {
moduleName.set("CBCRC - " + project.name)
includes.from("THING.md")
}
}
}
And then ./gradle dokkaGenerate
generated the site structure, but no sigh of the markdown file contentAdam Semenenko
05/21/2025, 4:11 PMbuild/tmp/
dir somewhere.Adam Semenenko
05/21/2025, 4:11 PMAdam Semenenko
05/21/2025, 4:12 PMSebastien Leclerc Lavallee
05/21/2025, 4:13 PM# Things
This and that
## Others
Stuff!
Adam Semenenko
05/21/2025, 4:14 PM# Module CBCRC project.name
This and that
## Others
Stuff!
Adam Semenenko
05/21/2025, 4:14 PMproject.name
with the actual project nameSebastien Leclerc Lavallee
05/21/2025, 4:15 PMSebastien Leclerc Lavallee
05/21/2025, 4:15 PMSebastien Leclerc Lavallee
05/21/2025, 5:42 PMModule <modulename>
but it did not fix my issue.
I'll put that aside for now. And get back to it later. Maybe try another way of applying this plugin (not inside subproject { }
)