Skip to content

Commit

Permalink
Add workaround for configuration error during maven publish (apple#342)
Browse files Browse the repository at this point in the history
The maven publish plugin isn't setting up dependencies correctly,
and we are getting errors like:

 "Task ':pkl-config-java:publishFatJarPublicationToMavenLocal' uses
  this output of task ':pkl-config-java:signLibraryPublication' without
   declaring an explicit or implicit dependency."

This adds a workaround for this type of error.
  • Loading branch information
bioball authored Mar 19, 2024
1 parent 46d6550 commit 7e948d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions buildSrc/src/main/kotlin/pklPublishLibrary.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ tasks.publish {
dependsOn(validatePom)
}

// Workaround for maven publish plugin not setting up dependencies correctly.
// Taken from https://github.com/gradle/gradle/issues/26091#issuecomment-1798137734
val dependsOnTasks = mutableListOf<String>()
tasks.withType<AbstractPublishToMaven>().configureEach {
dependsOnTasks.add(name.replace("publish", "sign").replaceAfter("Publication", ""))
dependsOn(dependsOnTasks)
}

signing {
// provided as env vars `ORG_GRADLE_PROJECT_signingKey` and `ORG_GRADLE_PROJECT_signingPassword`
// in CI.
Expand Down

0 comments on commit 7e948d3

Please sign in to comment.