wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Custom ANT Task not working in <for> loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Custom ANT Task not working in <for> loop" Watch "Custom ANT Task not working in <for> loop" New topic
Author

Custom ANT Task not working in <for> loop

Andrew Leer
Ranch Hand

Joined: Nov 11, 2003
Posts: 44
I've written a custom ANT task for purposes of returning an associated value from a file (that works almost like a hash map):


The left hand column above contains what the file is currently named. The right hand column above contains what I would like to rename the file to.

It's part of a web-app deployment for a very non-standard ecomm system (read: not Java, and not .NET etc..)

It's my Custom ANT task's job to take an argument of the file name, and return the corresponding file name for ANT to rename it to. In my ANT build.xml file I have

Note that ${csvDownloadList} looks like this:



However for some reason my <for> loop craps out after renaming one file. It seems to have something to do with my Custom ANT Task not being able to work within a <for> loop. Why is this? Is there some other class besides Task I need to extend to make this work?

Stranger still, the build succeeds, it doesn't throw an error or anything.

P.S. I'm using ANT 1.7.1 and ant-contrib-1.0b1.jar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custom ANT Task not working in <for> loop
 
Similar Threads
Problem: failed to create task or type for Cause: The name is undefined.
Creating for loops in ANT
Reading the property value from custom task inside calling target
Adding ANT Contrib tasks
Custom ANT Task and java.util.NoSuchElementException