Skip to content

Commit

Permalink
Improve publishing task dependencies and ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielThomas committed Jun 9, 2016
1 parent 609a8dc commit cdb2c3c
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/main/groovy/nebula/plugin/plugin/NebulaPluginPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ class NebulaPluginPlugin implements Plugin<Project> {
jacocoTestReport.executionData += files("$buildDir/jacoco/${task.name}.exec")
}

tasks.bintrayUpload.dependsOn tasks.check
tasks.artifactoryPublish.dependsOn tasks.check

gradle.taskGraph.whenReady { graph ->
tasks.bintrayUpload.onlyIf {
graph.hasTask(':final') || graph.hasTask(':candidate')
}
tasks.artifactoryPublish.onlyIf {
graph.hasTask(':snapshot') || graph.hasTask(':devSnapshot')
}
}

plugins.withId('com.gradle.plugin-publish') {
pluginBundle {
website = "https://github.com/nebula-plugins/${name}"
Expand All @@ -96,18 +108,13 @@ class NebulaPluginPlugin implements Plugin<Project> {
artifactId = project.name
}
}
def publishPlugins = tasks.publishPlugins
publishPlugins.dependsOn tasks.check
tasks.final.dependsOn publishPlugins
tasks.bintrayUpload.shouldRunAfter publishPlugins
}
tasks.publishPlugins.dependsOn tasks.check
tasks.bintrayUpload.dependsOn tasks.publishPlugins

gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
tasks.bintrayUpload.onlyIf {
graph.hasTask(':final') || graph.hasTask(':candidate')
}
tasks.artifactoryPublish.onlyIf {
graph.hasTask(':snapshot') || graph.hasTask(':devSnapshot')
gradle.taskGraph.whenReady { graph ->
tasks.publishPlugins.onlyIf {
graph.hasTask(':final')
}
}
}
}
Expand Down

0 comments on commit cdb2c3c

Please sign in to comment.