This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes How to iterate fileset? 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 "How to iterate fileset?" Watch "How to iterate fileset?" New topic
Author

How to iterate fileset?

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
We have following Ant code where we are getting <fileset>

<fileset id="id1" dir="D:/SN/two" includes="**/*.java">
<depend targetdir="D:/SN/one"/>
</fileset>

I want to iterate this <fileset>. How to achieve this?


My blood is tested +ve for Java.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

You'll have to provide more information. FileSets are properties of Ant tasks, so it depends on the Ant task you're attempting to execute.


Customer surveys are for companies who didn't pay proper attention to begin with.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
We are using Depend Selector. Basically it compares files at given two locations and give list of recently modified files as a FileSet.

http://ant.apache.org/manual/CoreTypes/selectors.html#dependselect
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Knock Knock!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

You could use the ant-contrib for loop task.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to iterate fileset?
 
Similar Threads
Ant - How to get needed class files from xerces.jar to myOwn.jar?
Ant Path problem
Ant: Logging the file names deleted in the build
Ant - How to get needed class files from xerces.jar to myOwn.jar?
Ant: How to conditionally include something in a custom task?