ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Ant Wiki] Update of "AntNewbies" by CharlieWanek
Date Fri, 24 Aug 2007 17:17:38 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ant Wiki" for change notification.

The following page has been changed by CharlieWanek:

The comment on the change is:
Example of using a ResourceCollection

  '''Answer #6 followup #2''' - Those needing this functionality should be pleased to know
that Ant 1.7 will support a new concept--ResourceCollection--an interface which exposes objects
of the existing Ant filelike-type Resource. Fileset, Dirset, Filelist, Path, etc. all implement
this new interface. One of the new ResourceCollection implementations is the <sort>
collection, which can sort resources according to their natural order, or by one or a combination
of ResourceComparators. Several of these have been predefined; however a user can custom-implement
and <typedef> his or her own ResourceComparator as well. 
+ '''Answer #6 example'''
+ Run ls -l on each file in the current directory, sorted by size:
+ {{{
+   <target name="sorttest">
+     <apply executable="ls">
+       <arg line="-l" />
+       <sort id="sorted-set" xmlns:rcmp=""
+         <rcmp:size/>
+         <fileset dir="." includes="*" />
+       </sort>
+     </apply>
+   </target>
+ }}}

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

View raw message