Skip to content

Commit

Permalink
Another attempt at fixing publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Dec 26, 2023
1 parent 0ab29a1 commit 03e3116
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gradle/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def license_url = 干.prop('base/maven', "${license}_url")
def license_comments =.prop('base/maven', "${license}_comments")

boolean isKMP = project.pluginManager.hasPlugin('org.jetbrains.kotlin.multiplatform')
boolean isPlugin = plugins.hasPlugin('java-gradle-plugin')

if (!isKMP) {
java {
withJavadocJar()
Expand Down Expand Up @@ -51,7 +53,12 @@ if (!isKMP) {
apply from: 干.file('helper/javadoc-view.gradle')
}

boolean isPlugin = plugins.hasPlugin('java-gradle-plugin')

if (publishing.publications.isEmpty()) {
publishing.publications.register(isPlugin ? 'pluginMaven' : 'mavenJava', MavenPublication, {
})
}

publishing.publications.withType(MavenPublication) {
// KMP-aware artifactId
if (artifactId.endsWith('-jvm')) {
Expand Down

0 comments on commit 03e3116

Please sign in to comment.