ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frode E. Moe" <fr...@CoreTrek.no>
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:
  <delete>
    <fileset dir="lib" includes="**/*.jar">
      <custom classname="com.coretrek.DuplicateSElector" />
    </fileset>
  </delete>

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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message