Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: JDK142, ANT154: Convert java class name to relative path

AW: JDK142, ANT154: Convert java class name to relative path

2007-07-25       - By Jan.Materne@(protected)

<project>
   <property name="myclass.name" value="com.foo.Bar"/>
   <ac:propertyregex
       xmlns:ac="antlib:net.sf.antcontrib"
       property="myclass.path"
       input="${myclass.name}"
       regexp="\."
       replace="/"
   />
   <echoproperties prefix="myclass."/>
</project>

Also have a look at the <unpackage> file mapper
http://ant.apache.org/manual/CoreTypes/mapper.html#unpackage-mapper


Jan




>-----Urspr?ngliche Nachricht-----
>Von: Karr, David [mailto:david.karr@(protected)]
>Gesendet: Mittwoch, 25. Juli 2007 01:54
>An: Ant Users List
>Betreff: JDK142, ANT154: Convert java class name to relative path
>
>I'm trying to build something that determines a set of file names to
>pass to the PMD Ant task.  At one step, I have a Java class name, and I
>need to convert it to a relative file path.  How do I convert
>a variable
>like "com.abc.stuff" to "com/abc/stuff" (I can deal with adding the
>prefixes and suffixes to that)?
>
>It looks like the Ant-contrib "propertyregex" task comes close, but I
>don't understand how to use it to get what I'm looking for.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@(protected)
>For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.