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: Convert Value to lower case
Date Tue, 26 Jun 2007 06:20:20 GMT
You would be interested in the new "props" AntLib in the sandbox ...
https://svn.apache.org/repos/asf/ant/sandbox/antlibs/props/trunk/


Jan

>-----Urspr√ľngliche Nachricht-----
>Von: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
>Gesendet: Dienstag, 26. Juni 2007 08:06
>An: Ant Users List
>Betreff: RE: Convert Value to lower case
>
> 
>Hi,
>
>-----Original Message-----
>From: Hardy Grueneis [mailto:Hardy.Grueneis@metris.de] 
>Sent: Tuesday, June 26, 2007 6:41 AM
>To: user@ant.apache.org
>Subject: Convert Value to lower case
>
>/*
>I want to convert the value of a property into lower cases.
>How can I do this with Ant 1.6.2?
> */
>
>i would go via <script> task and i.e JRuby =
>
><project name="bla" default="main" basedir=".">
>
><property name="testprop" value="DEMO"/>
>
><target name="depends">
>  <script language="ruby">
>  <![CDATA[
>    $project.setProperty "testprop" , $testprop.downcase
>  ]]>
> </script>			    
> </target>
>
><target name="main" depends="depends">
>  <echo>
>  $${testprop} == ${testprop}
>  </echo>  
> </target>
></project>
>
>gives you =
>
>[echo] ${testprop} == demo
>
>
>But beware, this does not follow the standard Ant convention of
>property immutability
>
>There are also possibillities with addon tasks
>like antelope <stringutils> or antcontrib (see property tasks)
>if you don't like using a scripting language like jruby,groovy,
>javascript, beanshell, jython ....
>
>http://antelope.tigris.org/
>http://ant-contrib.sourceforge.net/
>
>that's non standard Ant too; 
>this tasks does not follow the standard Ant convention of property
>immutability either;
>
> 
>Regards, Gilbert
>
>
>---------------------------------------------------------------------
>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