From 5b3a7efa94ca0e4fe5c713f54b55c8d1bd0f755b Mon Sep 17 00:00:00 2001 From: Lukellmann <47486203+Lukellmann@users.noreply.github.com> Date: Mon, 24 Apr 2023 13:38:04 +0200 Subject: [PATCH] Fix signing --- bom/build.gradle.kts | 6 ++++-- .../src/main/kotlin/kord-publishing.gradle.kts | 15 +++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 77b98f1a330..534d252b314 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -1,6 +1,6 @@ plugins { `java-platform` - `kord-publishing` + `maven-publish` } val me = project @@ -27,7 +27,9 @@ dependencies { } publishing { - publications.withType().configureEach { + publications.register(Library.name) { from(components["javaPlatform"]) } } + +apply(plugin = "kord-publishing") diff --git a/buildSrc/src/main/kotlin/kord-publishing.gradle.kts b/buildSrc/src/main/kotlin/kord-publishing.gradle.kts index ef32826cb90..546502d228b 100644 --- a/buildSrc/src/main/kotlin/kord-publishing.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-publishing.gradle.kts @@ -5,15 +5,18 @@ plugins { signing } -val dokkaJar by tasks.registering(Jar::class) { - archiveClassifier = "javadoc" - from(tasks.named("dokkaHtml")) -} +fun MavenPublication.registerDokkaJar() = + tasks.register("${name}DokkaJar") { + archiveClassifier = "javadoc" + destinationDirectory = destinationDirectory.get().dir(name) + from(tasks.named("dokkaHtml")) + } publishing { publications { withType().configureEach { - artifact(dokkaJar) + if (project.name != "bom") artifact(registerDokkaJar()) + groupId = Library.group artifactId = "kord-$artifactId" version = Library.version @@ -76,6 +79,6 @@ if (!isJitPack && Library.isRelease) { if (signingKey != null && signingPassword != null) { useInMemoryPgpKeys(String(Base64.getDecoder().decode(signingKey)), signingPassword) } - sign(publishing.publications[Library.name]) + sign(publishing.publications) } }