Skip to content

Commit

Permalink
Merge pull request #44 from chali/UpdateBintrayPlugin
Browse files Browse the repository at this point in the history
Update nebula bintray plugin
  • Loading branch information
chali authored Jun 12, 2018
2 parents c2248b6 + 9b82517 commit db79168
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 45 deletions.
78 changes: 39 additions & 39 deletions dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<Project> {

Expand All @@ -37,25 +39,30 @@ class PublishingPlugin implements Plugin<Project> {
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 {
Expand Down

0 comments on commit db79168

Please sign in to comment.