Skip to content

Commit

Permalink
predicate nexus publication
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Aug 15, 2023
1 parent f91a5b0 commit 31f27b5
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ fun Project.configurePublishing(repoName: String) {

fun Project.configureNexus() {
verifyRootProject { "Kotlin SDK nexus configuration must be applied to the root project only" }

val doConfigure = listOf(SONATYPE_USERNAME_PROP, SONATYPE_PASSWORD_PROP, PUBLISH_GROUP_NAME_PROP)
.all { project.hasProperty(it) }
if (!doConfigure) {
logger.info("skipping nexus configuration, missing required one or more required properties")
return
}

apply(plugin = "io.github.gradle-nexus.publish-plugin")
extensions.configure<NexusPublishExtension> {
val publishGroupName = project.property(PUBLISH_GROUP_NAME_PROP) as String
Expand Down

0 comments on commit 31f27b5

Please sign in to comment.