ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: JDK142, ANT154: Convert java class name to relative path
Date Wed, 25 Jul 2007 08:03:04 GMT
<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@wamu.net] 
>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@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message