File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ is a breaking change; the README has a
7474 incompatible major, and it requested a ` renderExample.js ` that does not exist.
7575- Building the plugin without registering a package now fails saying so, instead of scanning
7676 the package ` kotlin.Unit ` , which is a class and matches nothing.
77+ - The published ` javadoc ` jar contained nothing but a manifest, because it was built from the
78+ ` javadoc ` task and every source file is Kotlin. It is now rendered by Dokka.
7779
7880Set the date and add the release link below when the ` v7.0.0 ` tag is cut.
7981
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ plugins {
44 `maven- publish`
55 kotlin(" jvm" ) version " 2.2.20"
66 id(" io.gitlab.arturbosch.detekt" ) version " 1.23.8"
7+ id(" org.jetbrains.dokka" ) version " 2.2.0"
8+ id(" org.jetbrains.dokka-javadoc" ) version " 2.2.0"
79}
810
911detekt {
@@ -27,6 +29,23 @@ repositories {
2729 mavenCentral()
2830}
2931
32+ java {
33+ withJavadocJar()
34+ withSourcesJar()
35+ }
36+
37+ // `withJavadocJar()` fills the jar from the `javadoc` task, which has no Java source to read
38+ // here, so what shipped was 261 bytes containing nothing but a manifest. Dokka renders the KDoc
39+ // instead — the API this artifact documents is Kotlin.
40+ //
41+ // The jar is redirected rather than replaced by one of our own: `withJavadocJar()` is also what
42+ // registers the `javadocElements` variant, so a consumer resolving through Gradle module
43+ // metadata still finds the documentation. Declaring a separate task would publish the jar to
44+ // Maven and leave that variant missing.
45+ tasks.named<Jar >(" javadocJar" ) {
46+ from(tasks.dokkaGeneratePublicationJavadoc)
47+ }
48+
3049publishing {
3150 publications {
3251 create<MavenPublication >(" library" ) {
@@ -93,11 +112,6 @@ tasks.withType<JavaCompile>().configureEach {
93112 options.release.set(17 )
94113}
95114
96- java {
97- withJavadocJar()
98- withSourcesJar()
99- }
100-
101115dependencies {
102116 // All of these appear in this plugin's public API, so they belong on the consumer's
103117 // compile classpath: Javalin's Context and WsMessageContext in the builder and the
You can’t perform that action at this time.
0 commit comments