aspose file tools
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
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply 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: 14572
    
    7

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: 26496
    
  78

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to iterate fileset?
 
Similar Threads
Ant - How to get needed class files from xerces.jar to myOwn.jar?
Ant - How to get needed class files from xerces.jar to myOwn.jar?
Ant: How to conditionally include something in a custom task?
Ant: Logging the file names deleted in the build
Ant Path problem