ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frode E. Moe" <>
Subject custom selector which examines multiple files before returning an answer
Date Tue, 07 Jun 2005 14:07:47 GMT
Hi, I'm trying to implement a way to detect duplicate .jar files (where
only the version differ) and delete all duplicates except the newest.
The way I hoped to implement this was to use the <delete> task together
with a custom Selector, like this:
    <fileset dir="lib" includes="**/*.jar">
      <custom classname="com.coretrek.DuplicateSElector" />

Unfortunately this doesn't seem to work out very well, because the
FileSelector interface's "isSelected()" requires my class to provide an
answer for each file on the fly, while I need to read and sort 
the entire "candidate" fileset before selecting out the dupes.

Is there another way to implement a FileSet filtering mechanism that
would work for this purpose, or do I have to write a custom
"DeleteDuplicates" task?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message