Slackbot
07/06/2022, 12:34 PMChris Lee
07/06/2022, 1:20 PMprivate fun Project.configureRepoPublishing() {
// only enable publishing tasks for certain repos
tasks.withType<PublishToMavenRepository>().configureEach {
onlyIf(
providers.ciBuild().map {
when {
it -> when {
isSnapshotVersion() -> repository.isSnapshotRepo()
else -> repository.isReleaseRepo()
}
else -> repository.isLocalRepo()
}
}
)
}
}Satyarth Sampath
07/06/2022, 1:45 PMChris Lee
07/06/2022, 1:46 PMChris Lee
07/06/2022, 1:47 PMSatyarth Sampath
07/06/2022, 1:48 PMSatyarth Sampath
07/06/2022, 1:54 PMChris Lee
07/06/2022, 1:56 PMonlyIf or enabled on any given task.Vampire
07/06/2022, 11:37 PMdoFirst if you want a failure instead.Satyarth Sampath
07/07/2022, 7:42 AMSatyarth Sampath
07/07/2022, 7:43 AMVampire
07/07/2022, 5:25 PMonlyIf if you need delayed logic.