I would like to do something like this
On the tasks tab for your Ant Runtime do you see the 'if' task?