Abe Sol
01/05/2023, 1:28 PM0.1.0-dev.1+c35ad28
is not what I would like. How is that version string decided? is it gradle, dokka, something else? The hash part is correct coming from the latest commit. When I run the dokkaHtmlMultimodule
gradle task locally the version in the produced html files is 0.4.1
. This and this files are involved. Dokka version is 1.7.10. In the github action logs I can read
> Configure project :
Inferred project: openrndr, version: 0.1.0-dev.1+c35ad28
Gleb Minaev
01/05/2023, 2:23 PM<@version/>
to display the version you are talking about (it is mentioned at the very bottom of HTML output format docs; also you can see its usage in default template here). Dokka's docs also says that you can change the template variable via versioning plugin by specifiying corresponding parameter version
of the plugin in your build script.Abe Sol
01/05/2023, 2:34 PM@version
value when ran locally vs ran on github.Ignat Beresnev
01/05/2023, 2:36 PMmoduleVersion
configuration property
Try adding this to the root buildscript file:
tasks.withType<DokkaMultiModuleTask>().configureEach {
moduleVersion.set("HEADER_VERSION_HERE")
}
Abe Sol
01/05/2023, 2:37 PMIgnat Beresnev
01/05/2023, 2:40 PMmoduleVersion
of the MultiModule task configuration.
How is that version string decided?The default value of
moduleVersion
is project.version.toString()
, javadoc: Project#getVersion()
How it's chosen and why it's different for github actions is beyond my understanding of Gradle, unfortunately ๐
But yeah, you can just override moduleVersion
with your own valueIgnat Beresnev
01/05/2023, 2:45 PMversion.toString()
is wrong on Dokka's end, as it can be any Object
with any toString()
implementation - that would explain the hash part. Although I'm not sure what types exactly Gradle can return, and what can override it.Abe Sol
01/05/2023, 2:46 PMAbe Sol
01/05/2023, 2:49 PM0.4.1-dev.57.uncommitted+c39fefc
It also includes the hash of the last git commit.Javier
01/07/2023, 1:01 AMJavier
01/07/2023, 1:03 AM@Input
val moduleVersion: Property<String> = project.objects.safeProperty<String>()
.safeConvention(project.version.toString())
Javier
01/07/2023, 1:05 AM@Input
val moduleVersion: Property<String> = project.objects.safeProperty<String>()
.safeConvention(project.provider { project.version.toString() })
Javier
01/07/2023, 1:10 AM