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.
+2-1
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

+10-5
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,10 +131,13 @@ location of your Java installation."
133131
fi
134132
else
135133
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
@@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
197198
done
198199
fi
199200

201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
200205
# Collect all arguments for the java command;
201206
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202207
# shell script including quotes and variable substitutions, so put them in

plugin/build.gradle

+13-8
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)