From 9b8251766b7115d67153c6a31d77335a0347ae2c Mon Sep 17 00:00:00 2001 From: Martin Chalupa Date: Tue, 12 Jun 2018 13:13:01 -0700 Subject: [PATCH] Update nebula bintray plugin --- dependencies.lock | 78 +++++++++---------- .../publishing/PublishingPlugin.groovy | 19 +++-- 2 files changed, 52 insertions(+), 45 deletions(-) diff --git a/dependencies.lock b/dependencies.lock index e0c3a63..b13b98b 100644 --- a/dependencies.lock +++ b/dependencies.lock @@ -17,7 +17,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -29,11 +29,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin": { @@ -59,7 +59,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -71,11 +71,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin": { @@ -101,7 +101,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -113,11 +113,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin": { @@ -143,7 +143,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -155,11 +155,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { @@ -193,7 +193,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -205,11 +205,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { @@ -243,7 +243,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -255,11 +255,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { @@ -293,7 +293,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -305,11 +305,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { @@ -353,7 +353,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -365,11 +365,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin": { @@ -395,7 +395,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -407,11 +407,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin": { @@ -437,7 +437,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -449,11 +449,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { @@ -487,7 +487,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -499,11 +499,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { @@ -537,7 +537,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -549,11 +549,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { @@ -587,7 +587,7 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-bintray-plugin": { - "locked": "3.5.3", + "locked": "3.5.4", "requested": "latest.release" }, "com.netflix.nebula:nebula-core": { @@ -599,11 +599,11 @@ "requested": "latest.release" }, "com.netflix.nebula:nebula-publishing-plugin": { - "locked": "7.2.0", + "locked": "7.2.3", "requested": "latest.release" }, "com.netflix.nebula:nebula-release-plugin": { - "locked": "6.3.3", + "locked": "6.3.5", "requested": "latest.release" }, "com.netflix.nebula:nebula-test": { diff --git a/src/main/groovy/nebula/plugin/netflixossproject/publishing/PublishingPlugin.groovy b/src/main/groovy/nebula/plugin/netflixossproject/publishing/PublishingPlugin.groovy index 9c1cea6..fdfe641 100644 --- a/src/main/groovy/nebula/plugin/netflixossproject/publishing/PublishingPlugin.groovy +++ b/src/main/groovy/nebula/plugin/netflixossproject/publishing/PublishingPlugin.groovy @@ -16,7 +16,8 @@ package nebula.plugin.netflixossproject.publishing import com.jfrog.bintray.gradle.BintrayExtension -import com.jfrog.bintray.gradle.BintrayUploadTask +import com.jfrog.bintray.gradle.tasks.BintrayUploadTask +import com.jfrog.bintray.gradle.tasks.BintrayPublishTask import nebula.plugin.bintray.BintrayPlugin import nebula.plugin.info.scm.ScmInfoExtension import org.gradle.api.Plugin @@ -25,6 +26,7 @@ import org.gradle.api.Task import org.gradle.api.execution.TaskExecutionGraph import org.gradle.api.tasks.Upload import org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask +import org.jfrog.gradle.plugin.artifactory.task.DeployTask class PublishingPlugin implements Plugin { @@ -37,25 +39,30 @@ class PublishingPlugin implements Plugin { it.enabled = !dryRun } - project.plugins.apply org.gradle.api.publish.plugins.PublishingPlugin - project.plugins.apply BintrayPlugin - project.tasks.withType(BintrayUploadTask, disable) - project.tasks.withType(BintrayUploadTask) { Task task -> + def runOnlyForCandidateAndFinal = { Task task -> project.gradle.taskGraph.whenReady { TaskExecutionGraph graph -> task.onlyIf { graph.hasTask(':final') || graph.hasTask(':candidate') } } } + project.plugins.apply org.gradle.api.publish.plugins.PublishingPlugin + project.plugins.apply BintrayPlugin + project.tasks.withType(BintrayUploadTask, disable) + project.tasks.withType(BintrayUploadTask, runOnlyForCandidateAndFinal) + project.tasks.withType(BintrayPublishTask, disable) + project.tasks.withType(BintrayPublishTask, runOnlyForCandidateAndFinal) project.tasks.withType(Upload, disable) project.tasks.withType(ArtifactoryTask, disable) - project.tasks.withType(ArtifactoryTask) { Task task -> + def runOnlyForSnapshots = { Task task -> project.gradle.taskGraph.whenReady { TaskExecutionGraph graph -> task.onlyIf { graph.hasTask(':snapshot') || graph.hasTask(':devSnapshot') } } } + project.tasks.withType(ArtifactoryTask, runOnlyForSnapshots) + project.tasks.withType(DeployTask, runOnlyForSnapshots) BintrayExtension bintray = project.extensions.getByType(BintrayExtension) bintray.pkg.with {