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: changing a java package name to a directory path
Date Wed, 18 Jun 2003 11:07:19 GMT
Use <propertyregex/> of Ant-Contrib


<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="test" basedir="." default="main">
    <target name="main">
        <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
        <property name="package" value="org.apache.tools.ant" />
        <propertyregex property="path" input="${package}" regexp="\."
replace="/" global="true" />
        <echo message="package = ${package}"/>
        <echo message="path    = ${path}"/>
    </target>
</project>


gave me

main:
     [echo] package = org.apache.tools.ant
     [echo] path    = org/apache/tools/ant

BUILD SUCCESSFUL



Ant-Contrib:
  Homepage:   http://sourceforge.net/projects/ant-contrib/
  CVS-Source:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant-contrib/src/n
et/sf/antcontrib/
  CVS-Manual:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant-contrib/manua
l/index.html
	
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/ant-contrib/ant-co
ntrib/manual/tasks/index.html
  Binary:     http://gump.covalent.net/jars/latest/ant-contrib/




Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Adam Hardy [mailto:adam.ant@cyberspaceroad.com]
> Gesendet am: Mittwoch, 18. Juni 2003 12:55
> An: user@ant.apache.org
> Betreff: changing a java package name to a directory path
> 
> Hi,
> 
> I would like to create a directory path	from a property 
> containing a 
> java package name.
> 
> e.g.:
> 
> org.foo.bar to org/foo/bar
> 
> Is there a way of doing this in Ant? I'm using JAXB (the xml binding 
> package). I created a task to run its executable xjc, which creates a 
> package of java classes from an xml schema. You have to give it a 
> package name, e.g. org.foo.bar, to create. It's this property 
> I need to 
> convert into a path so I can check if it's <uptodate> in 
> comparison with 
> the xml schema.
> 
> Thanks in advance for any help,
> 
> Adam
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message