Skip to content

Commit

Permalink
Use Gradle Nexus Publish Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Feb 26, 2024
1 parent ac9cb32 commit f7371fe
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,39 +76,7 @@ class SonatypePlugin : Plugin<Project> {
}
}

addParentPublishToSonatypeTasks()

disallowPublishTasks()

afterEvaluate {
tasks.named("closeStagingRepository") {
mustRunAfter("publishToSonatype")
}
}
}
}

/**
* Recursively add publishToSonatype (if not exists) which depends on the children.
*/
private fun Project.addParentPublishToSonatypeTasks() {
allprojects {
val parent = project.parent
if (parent != null) {
tasks.matching { it.name == "publishToSonatype" }.configureEach {
val parentProvider =
try {
parent.tasks.named("publishToSonatype")
} catch (e: UnknownTaskException) {
parent.tasks.register("publishToSonatype")
}
this.let { childTask ->
parentProvider.configure {
dependsOn(childTask)
}
}
}
}
}
}

Expand Down

0 comments on commit f7371fe

Please sign in to comment.