ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Galbraith" <pgalbra...@trigoncanada.com>
Subject Regexp mapper example
Date Fri, 30 Jul 2004 19:21:46 GMT
I spent more time than I'm willing to admit trying to use the regexp
mapper to map class files back to java source.  I figure the following
example might serve others if it were added to the mapper.html doc page.
Below is a small diff -u from /ant/doc/manual/CoreTypes/mapper.html
[1.13.2.4].  Cheers,

Paul

P.S. I'm not subscribed to the dev list, nor do I want to be; please
copy any comments to me privately.

--- mapper.html.orig	2004-07-30 15:09:50.343750000 -0400
+++ mapper.html	2004-07-30 15:07:20.500000000 -0400
@@ -363,6 +363,32 @@
     <td valign="top"><code>properties.Classes/dir/dir2/A</code></td>
   </tr>
 </table>
+<blockquote><pre>
+&lt;mapper type=&quot;regexp&quot;
from=&quot;^(.*?)(\$$[^/\\\.]*)?\.class$$&quot;
to=&quot;\1.java&quot;/&gt;
+&lt;regexpmapper from=&quot;^(.*?)(\$$[^/\\\.]*)?\.class$$&quot;
to=&quot;\1.java&quot;/&gt;
+</pre></blockquote>
+<table border="1" cellpadding="2" cellspacing="0">
+  <tr>
+    <td valign="top"><b>Source file name</b></td>
+    <td valign="top"><b>Target file name</b></td>
+  </tr>
+  <tr>
+    <td valign="top"><code>ClassLoader.class</code></td>
+    <td valign="top"><code>ClassLoader.java</code></td>
+  </tr>
+  <tr>
+    <td valign="top"><code>java/lang/ClassLoader.class</code></td>
+    <td valign="top"><code>java/lang/ClassLoader.java</code></td>
+  </tr>
+  <tr>
+    <td valign="top"><code>java\lang\ClassLoader$1.class</code></td>
+    <td valign="top"><code>java\lang\ClassLoader.java</code></td>
+  </tr>
+  <tr>
+    <td
valign="top"><code>java/lang/ClassLoader$foo$1.class</code></td>
+    <td valign="top"><code>java/lang/ClassLoader.java</code></td>
+  </tr>
+</table>
 
 <h4><a name="package-mapper">package</a></h4>
 <p>Sharing the same syntax as the <a href="#glob-mapper">glob
mapper</a>,


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


Mime
View raw message