Is there an if/else condition that I can use for an Ant task?
This is what i have written so far:
The quirky syntax using conditions on the target (described by Mads) is the only supported way to perform conditional execution in core ANT.
ANT is not a programming language and when things get complicated I choose to embed a script within my build as follows:
if (properties["some.condition"] == "true") {
ant.copy(file:"${properties["some.dir"]}/true", todir:".")
}
ANT supports several languages (See script task), my preference is Groovy because of it's terse syntax and because it plays so well with the build.
Apologies, David I am not a fan of ant-contrib.