List Info

Thread: Update of "AntNewbies" by CharlieWanek




Update of "AntNewbies" by CharlieWanek
country flaguser name
United States
2007-08-24 12:17:38
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:
http://wiki.apa
che.org/ant/AntNewbies

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="antlib:org.apache.tools.ant.types.resources
.comparators" >
+         <rcmp:size/>
+         <fileset dir="."
includes="*" />
+       </sort>
+     </apply>
+   </target>
+ }}}
+ 
  
 
------------------------------------------------------------
--------------------
  

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )