ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r521145 - /ant/core/trunk/docs/manual/CoreTypes/resources.html
Date Thu, 22 Mar 2007 08:07:39 GMT
Author: jhm
Date: Thu Mar 22 01:07:38 2007
New Revision: 521145

URL: http://svn.apache.org/viewvc?view=rev&rev=521145
Log:
Add examples for <sort>. Got it from testcase and user-list (Matt).

Modified:
    ant/core/trunk/docs/manual/CoreTypes/resources.html

Modified: ant/core/trunk/docs/manual/CoreTypes/resources.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/resources.html?view=diff&rev=521145&r1=521144&r2=521145
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/resources.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/resources.html Thu Mar 22 01:07:38 2007
@@ -742,6 +742,30 @@
   <h4><a name="rcmp.reverse">reverse</a></h4>
   <p>Reverse the natural sort order, or that of a single nested comparator.</p>
 
+  <h4>Examples</h4>
+  <pre>
+    &lt;property name=&quot;eol&quot; value=&quot;${line.separator}&quot;
/&gt;
+    &lt;pathconvert property=&quot;sorted&quot; pathsep=&quot;${eol}&quot;&gt;
+      &lt;sort&gt;
+        &lt;tokens&gt;
+          &lt;string value=&quot;foo bar etc baz&quot; /&gt;
+          &lt;stringtokenizer /&gt;
+        &lt;/tokens&gt;
+      &lt;/sort&gt;
+    &lt;/pathconvert&gt;</pre>
+  <p>The resource of type string &quot;foo bar etc baz&quot; is split into
four tokens by 
+  the stringtokenizer. These tokens are sorted and there <i>sorted</i> gets the
value
+  of &quot;bar baz etc foo&quot;.</p>
+  
+  <pre>
+    &lt;sort&gt;
+      &lt;fileset dir=&quot;foo&quot; /&gt;
+      &lt;reverse&gt;
+        &lt;date /&gt;
+      &lt;/reverse&gt;
+    &lt;/sort&gt;</pre>
+  <p>This takes all files from <i>foo</i> and sorts it by modification
date in reverse order.</p>  
+
 </blockquote>
 
 <h4><a name="first">first</a></h4>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message