I am a newbie to Groovy (playing catch up) and i have been trying to use the Job DSL Plugin. Everything works out great for me as long as i have everything in the DSL but i have a need to do it more programmatically. I looked through the Gradle DSL example and some more but couldn't find something which fits my need and works right.
job {
name 'ci'
description 'Build and test the app.'
scm {
git {
remote {
github 'sheehan/job-dsl-playground'
}
}
}
steps {
gradle 'test'
}
publishers {
archiveJunit 'build/test-results/**/*.xml'
}
}
Now, i want to keep this DSL and i want to be able to attach the publishers section of this DSL by calling an API, something like
job {
**** details taken out ***
gradle 'test'
}
publishers "${AnotherClass.configurePublishers()}"
}
How do i go about doing something like this?
Any pointers will be appreciated
Thanks