javaposse.jobdsl.dsl.helpers.wrapper.WrapperContextHelper.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.wrapper
import javaposse.jobdsl.dsl.JobManagement
import javaposse.jobdsl.dsl.JobType
import javaposse.jobdsl.dsl.WithXmlAction
import javaposse.jobdsl.dsl.helpers.AbstractContextHelper
class WrapperContextHelper extends AbstractContextHelper {
JobManagement jobManagement
WrapperContextHelper(List withXmlActions, JobType jobType, JobManagement jobManagement) {
super(withXmlActions, jobType)
this.jobManagement = jobManagement
}
def wrappers(Closure closure) {
execute(closure, new WrapperContext(type, jobManagement))
}
Closure generateWithXmlClosure(WrapperContext context) {
return { Node project ->
def wrapperNode
if (project.buildWrappers.isEmpty()) {
wrapperNode = project.appendNode('buildWrappers')
} else {
wrapperNode = project.buildWrappers[0]
}
context.wrapperNodes.each {
wrapperNode << it
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy