ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Blanc <Sebastien.Bl...@alcatel.com>
Subject r_e_m_o_v_e a string within a path
Date Tue, 01 Jul 2003 16:20:05 GMT
Hi !

I'm trying to remove a source directory from a path (in a property). I
don't want to use ReplaceRegExp for now but I think that would be the
same pb anyway (not looking at a <script> solution either).

I tried the following:

   <property name="tmp.properties" value="tmp.properties" />
   <propertyfile file="${tmp.properties}">
       <entry key="tmp.package" value="${xml.source.dir}"/>
   </propertyfile>
   <replace file="${tmp.properties}" token="${source.dir}" value="" />
   <property file="${tmp.properties}" />
   <echo>package name = ${tmp.package}</echo>

I however get no transformation.

when I echo ${source.dir} and ${xml.source.dir} I get the following:

[echo] removing C:\Data\1671sc\src\dao/main from
C:\Data\1671sc\src\dao\main\com\alcatel\gem\ne1671\R01_00_00\dao\xml

also after the <property call> I get (WIN32):
tmp.package=C\:\\Data\\1671sc\\src\\dao\\main\\com\\alcatel\\gem\\ne1671\\R01_00_00\\dao\\xml

in the tmp.properties file.

do I need to make a first pass to escape all '/' and '\' in
${source.dir} or this there an easiest to remove a string from a path in

a portable way ?

thanx.

seb.


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


Mime
View raw message