I was pondering about this earlier today. Wondering how I would invoke an Ant task that used nested text data using Groovy Ant. Why? Because I looked at the Ant script task while browsing Ant docs and said, “Hmm. that’d be neat to embed a script in a GroovyAnt build… but how do I pass text?” Well it just dawned on me that the random errors I’d been getting with Groovy’s AntBuilder exposed the answer. Occasionally I’ll forget to prefix a task attribute with an attribute name like:
ant.available(property:'menu.icon.found', '/menu.png', classpath:'target/MapQuestCoolStuff.jar')
And I’ll get an error saying:
ERR: SCRIPT FAILED: The type doesn't support nested text data ("/menu.png").
ERR: The type doesn't support nested text data ("/menu.png").
It’s telling me that the second parameter is being passed to AntBuilder as text instead of a task attribute.