Skip to content

Commit 29beee5

Browse files
authored
Fix: Uploading artifacts to Gradle Plugin Portal and Maven Central (#110)
1 parent b4bb0a2 commit 29beee5

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

gradle/wrapper/gradle-wrapper.jar

2.06 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/build.gradle

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.vanniktech.maven.publish.GradlePlugin
2-
import com.vanniktech.maven.publish.JavadocJar
31
import com.vanniktech.maven.publish.SonatypeHost
42

53
plugins {
@@ -39,12 +37,6 @@ jacocoTestReport {
3937
}
4038

4139
mavenPublishing {
42-
// Override default configuration: by default `com.vanniktech.maven.publish` uses
43-
// `new GradlePublishPlugin()` because it detects that we use `com.gradle.plugin-publish`.
44-
// However since we also publish to Maven Central the default publication created by
45-
// `com.gradle.plugin-publish` is not suitable (Maven Central publication requires sources
46-
// and Javadoc).
47-
configure(new GradlePlugin(new JavadocJar.Dokka("dokkaHtml")))
4840
publishToMavenCentral(SonatypeHost.S01)
4941
signAllPublications()
5042
}
@@ -63,6 +55,19 @@ gradlePlugin {
6355
}
6456
}
6557

58+
// Since version 1.0.0 com.gradle.plugin-publish creates it's own javadocs, these do not
59+
// seem to support Kotlin and end-up empty. The plugin does not provide an easy way to
60+
// use Dokka or modify it.
61+
// The code below disables the default javadoc task, and modifies the javadocJar task to use dokka
62+
// instead.
63+
tasks.named('javadoc') {
64+
enabled = false
65+
}
66+
tasks.register('javadocJar', Jar) {
67+
archiveClassifier.set('javadoc')
68+
dependsOn tasks.dokkaHtml
69+
from tasks.dokkaHtml
70+
}
6671
test {
6772
testLogging {
6873
events "passed", "skipped", "failed"

0 commit comments

Comments
 (0)