ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus M. May" <m...@gmx.net>
Subject Re: RE: How to replace substring into property and get result intoanother property ?
Date Tue, 29 Aug 2006 11:10:25 GMT
You could also use the antcontrib task PropertyRegex. 

R,

Markus

-------- Original-Nachricht --------
Datum: Tue, 29 Aug 2006 12:47:25 +0200
Von: "Rebhan, Gilbert" <Gilbert.Rebhan@huk-coburg.de>
An: "Ant Users List" <user@ant.apache.org>
Betreff: RE: How to replace substring into property and get result intoanother property ?

> One possible solution via <script>, f.e.
> with javascript =
> 
> <property name="foobar"
> value="lib/iaik/iaik_jce.jar,lib/iaik/iaikPkcs11Provider.jar"/>
> 
> <target name="depends">
>      
> <script language="javascript">
>         s=project.getProperty("foobar").replace(',',':');
>         project.setProperty("myotherproperty", s);
> </script>
> 
> <!-- also possible to overwrite ${foobar} when using
> 
> <script language="javascript">
>         s=project.getProperty("foobar").replace(',',':');
>         project.setProperty("foobar", s);
> </script>
> 
> -->
> 
> 
> <echo>$${myotherproperty} == ${myotherproperty}</echo>
> 
> </target>
> 
> depends:
>      [echo] ${myotherproperty} ==
> lib/iaik/iaik_jce.jar:lib/iaik/iaikPkcs11Provider.jar
> 
> 
> Regards, Gilbert
> 
> 
> -----Original Message-----
> From: Willy Reinhardt [mailto:wreinhardt@ctp.com] 
> Sent: Tuesday, August 29, 2006 12:32 PM
> To: Ant Users List
> Subject: How to replace substring into property and get result
> intoanother property ?
> 
> Hi, 
> I get a property value as : 
> lib/iaik/iaik_jce.jar,lib/iaik/iaikPkcs11Provider.jar 
> 
> and would replace character "," by ";" or ":" 
> 
> is a ant task can do that ? 
> 
> Thanks 
> 
> Willy 
> 
> ---------------------------------------------------------------------
> 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