Slackbot
02/28/2022, 10:59 PMChris
02/28/2022, 11:11 PMsourcesElements outgoing variant?tony
02/28/2022, 11:12 PM{
"name": "sourcesElements",
"attributes": {
"org.gradle.category": "documentation",
"org.gradle.dependency.bundling": "external",
"org.gradle.docstype": "sources",
"org.gradle.usage": "java-runtime"
},
"files": [
{
"name": "testkit-truth-1.0-SNAPSHOT-sources.jar",
"url": "testkit-truth-1.0-SNAPSHOT-sources.jar",
"size": 3473,
"sha512": "918e200ba2d912ae4ef5fe7587a244b65aac881cf9d376c7e72c3c004212ae7889929ac629cff2ef5d09c157eaf14bc14391c302a3d8545103e797894de5496c",
"sha256": "0a02a5dcb8d96d1104eb421e7e4eefdd63b83b81cfce635660927830cddb61b6",
"sha1": "0b628e4fb67a3d5350ec44dd8514592f9f9b0ff9",
"md5": "a87112d777f22b9cc6e09c81cf0be356"
}
]
}ephemient
02/28/2022, 11:13 PMwithJavadocJar() calls into https://github.com/gradle/gradle/blob/2cb4012f55636266937b504cf580c1077c070969/subprojects/plugins/src/main/java/org/gradle/api/plugins/internal/JvmPluginsHelper.java#L251 which is the the bit that adds it to the software component so that it gets published in the module metadata. not sure how to set that up with Dokka but maybe that'll point you in the right directionChris
02/28/2022, 11:13 PMsourcesElementsChris
02/28/2022, 11:14 PMtony
02/28/2022, 11:16 PMChris
02/28/2022, 11:17 PMjvmPluginServices.createOutgoingElements("dokkaElements", builder -> builder.withDescription("Dokka documentation stuff")
.published().artifact(dokkaJarTask).providesAttributes(attributes -> attributes.documentation("dokka").asJar()));Chris
02/28/2022, 11:20 PMtony
02/28/2022, 11:30 PMtony
03/01/2022, 12:16 AMwithJavadocJar() with
val javadocJar = tasks.named<Jar>("javadocJar") {
from(dokkaJavadoc)
}
and that seems to work
the .module file has it now, and the javadoc jar is publishedJendrik Johannes
03/01/2022, 8:08 AMartifact(...) , don’t use that anymore!). So ideally you should only use from(...) there. (+ Maybe some POM-Metadata additions for informational data that can only be represented there - like <licenses> , <scm> etc. - if you need it.)tony
03/01/2022, 9:23 AMJendrik Johannes
03/04/2022, 9:30 PM