diff --git a/build-logic/convention/src/main/kotlin/io/github/ikarenkov/kombucha/Publishing.kt b/build-logic/convention/src/main/kotlin/io/github/ikarenkov/kombucha/Publishing.kt index ae7311d..0d7bdd8 100644 --- a/build-logic/convention/src/main/kotlin/io/github/ikarenkov/kombucha/Publishing.kt +++ b/build-logic/convention/src/main/kotlin/io/github/ikarenkov/kombucha/Publishing.kt @@ -4,6 +4,7 @@ import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPom import org.gradle.api.publish.maven.MavenPublication +import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven import org.gradle.api.tasks.bundling.Jar import org.gradle.kotlin.dsl.assign import org.gradle.kotlin.dsl.configure @@ -12,6 +13,7 @@ import org.gradle.kotlin.dsl.findByType import org.gradle.kotlin.dsl.maven import org.gradle.kotlin.dsl.register import org.gradle.kotlin.dsl.withType +import org.gradle.plugins.signing.Sign import org.gradle.plugins.signing.SigningExtension import java.util.Properties @@ -22,7 +24,23 @@ internal fun Project.setupPublishing() { archiveClassifier.set("javadoc") } + val isSigningEnabled = getExtraString("signing.keyId") != null + + if (isSigningEnabled) { + // Workaround for https://github.com/gradle/gradle/issues/26091 and https://youtrack.jetbrains.com/issue/KT-46466 + val signingTasks = tasks.withType() + tasks.withType().configureEach { + dependsOn(signingTasks) + } + } + configure { + if (isSigningEnabled) { + configure { + // Signing artifacts. Signing.* extra properties values will be used + sign(publications) + } + } // Configure maven central repository repositories { maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") { @@ -47,8 +65,8 @@ internal fun Project.setupPublishing() { pom { name = "Kombucha UDF" description = - "UDF library for state hosting based on ELM principles. " + - "It helps distinguish pure functions from the othe ones and keep logic inside pure function." + "UDF library based on The Elm Architecture (TEA) concepts that helps to focus on logic of you application, " + + "rather then understanding what is going on." url = "https://github.com/ikarenkov/kombucha-udf" setupLicense() @@ -62,15 +80,6 @@ internal fun Project.setupPublishing() { val publications = extensions.findByType()?.publications - configure { - if (getExtraString("signing.keyId") != null) { - // Signing artifacts. Signing.* extra properties values will be used - publications?.let { - sign(it) - } - } - } - afterEvaluate { publications?.withType { artifactId = "kombucha-$artifactId" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d4a0adb..3764594 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] -kombucha = "0.1" +kombucha = "0.1.1" kotlin = "1.9.21" kotlinCompilerExtension = "1.5.7"