Is there an if/else condition that I can use for an Ant task?
This is what i have written so far:
The if attribute does not exist for . It should be applied to the .
Below is an example of how you can use the depends attribute of a target and the if and unless attributes to control execution of dependent targets. Only one of the two should execute.
Get file based on condition being true
Get file based on condition being false
If you are using ANT 1.8+, then you can use property expansion and it will evaluate the value of the property to determine the boolean value. So, you could use if="${copy-condition}" instead of if="copy-condition".
In ANT 1.7.1 and earlier, you specify the name of the property. If the property is defined and has any value (even an empty string), then it will evaluate to true.