Skip to content

Commit

Permalink
Stop using deprecated dependsOnTaskDidWork
Browse files Browse the repository at this point in the history
Explicitly check task for didWork, since the old approach is deprecated.

This fixes #32.
  • Loading branch information
ajoberstar committed Oct 13, 2017
1 parent a022d7d commit bdd4e98
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GitPublishPlugin implements Plugin<Project> {
Task reset = createResetTask(project, extension)
Task copy = createCopyTask(project, extension)
Task commit = createCommitTask(project, extension)
Task push = createPushTask(project, extension)
Task push = createPushTask(project, extension, commit)
push.dependsOn commit
commit.dependsOn copy
copy.dependsOn reset
Expand Down Expand Up @@ -151,13 +151,13 @@ class GitPublishPlugin implements Plugin<Project> {
return task
}

private Task createPushTask(Project project, GitPublishExtension extension) {
private Task createPushTask(Project project, GitPublishExtension extension, Task commit) {
Task task = project.tasks.create(PUSH_TASK)
task.with {
group = 'publishing'
description = 'Pushes changes to git.'
// if we didn't commit anything, don't push anything
onlyIf { dependsOnTaskDidWork() }
onlyIf { commit.didWork }
doLast {
extension.repo.push()
}
Expand Down

0 comments on commit bdd4e98

Please sign in to comment.