Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: Convert Value to lower case

AW: Convert Value to lower case

2007-06-26       - By Jan.Materne@(protected)
Reply:     1     2     3     4     5     6     7  

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@(protected)]
>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@(protected)]
>Sent: Tuesday, June 26, 2007 6:41 AM
>To: user@(protected)
>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@(protected)
>For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.