> I'm wondering if it is possible to have conditional execution of the
configuration closure?
For conditional execution you can use the onlyIf closure:
project.task([type:SvnCopyTask], 'tagRelease){
onlyIf {
<your condition goes here>
}
message = project.tagMessage
src = project.svnSrc
dest = project.svnDest
}
> when I'm declaring for example the svn copy task it uses parameters which
aren't available unless one is wanting to execute that task
Does this means that you actually want to conditionally add the task?
Something like this, then:
if (project.hasProperty('tagMessage') { // or any other condition you'd like
project.task([type:SvnCopyTask], 'tagRelease){
message = project.tagMessage
src = project.svnSrc
dest = project.svnDest
}
}
Your task definition line shows just how flexible gradle really is, I would
have written it like this:
task tagRelease (type: SvnCopyTask)
Regards,
Steinar