Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Revert "tasks.withType: use configureEach"
Browse files Browse the repository at this point in the history
This reverts commit a67f1d9.
  • Loading branch information
rpalcolea committed Nov 2, 2019
1 parent a67f1d9 commit 26800bd
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/main/groovy/nebula/plugin/stash/StashRestBasePlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package nebula.plugin.stash

import nebula.plugin.stash.tasks.StashTask
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project

Expand All @@ -15,15 +14,12 @@ class StashRestBasePlugin implements Plugin<Project> {
}

private void configureStashTasks(Project project, StashPluginExtension extension) {
project.tasks.withType(StashTask).configureEach(new Action<StashTask>() {
@Override
void execute(StashTask stashTask) {
stashTask.conventionMapping.stashRepo = { project.hasProperty('stashRepo') ? project.stashRepo : extension.stashRepo }
stashTask. conventionMapping.stashProject = { project.hasProperty('stashProject') ? project.stashProject : extension.stashProject }
stashTask. conventionMapping.stashHost = { project.hasProperty('stashHost') ? project.stashHost : extension.stashHost }
stashTask.conventionMapping.stashUser = { project.hasProperty('stashUser') ? project.stashUser : extension.stashUser }
stashTask.conventionMapping.stashPassword = { project.hasProperty('stashPassword') ? project.stashPassword : extension.stashPassword }
}
})
project.tasks.withType(StashTask) {
conventionMapping.stashRepo = { project.hasProperty('stashRepo') ? project.stashRepo : extension.stashRepo }
conventionMapping.stashProject = { project.hasProperty('stashProject') ? project.stashProject : extension.stashProject }
conventionMapping.stashHost = { project.hasProperty('stashHost') ? project.stashHost : extension.stashHost }
conventionMapping.stashUser = { project.hasProperty('stashUser') ? project.stashUser : extension.stashUser }
conventionMapping.stashPassword = { project.hasProperty('stashPassword') ? project.stashPassword : extension.stashPassword }
}
}
}

0 comments on commit 26800bd

Please sign in to comment.