javaposse.jobdsl.dsl.helpers.AbstractHelper.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of job-dsl-core Show documentation
Show all versions of job-dsl-core Show documentation
Javaposse jenkins job-dsl-core
package javaposse.jobdsl.dsl.helpers
import javaposse.jobdsl.dsl.JobType
import javaposse.jobdsl.dsl.WithXmlAction
/**
* Base for all helpers, providing an easy ability to create WithXmlActions
*/
public class AbstractHelper implements Helper {
/**
* Global list of all withXmlActions. Helper should append to it as they get called. They could prepend to the list,
* that is not advised. They can scan the list so fat to look special implementations of WithXmlAction, which might
* effect their behavior.
*/
List withXmlActions
JobType type
AbstractHelper(List withXmlActions, JobType type) {
this.withXmlActions = withXmlActions
this.type = type
}
WithXmlAction execute(Closure rootClosure) {
rootClosure.resolveStrategy = Closure.DELEGATE_FIRST
def action = new WithXmlAction(rootClosure)
withXmlActions << action
return action
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy