ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: String translation/regex
Date Mon, 04 Mar 2002 22:53:40 GMT
This is actually one of the better uses of <script> around.  Again, to
clarify - I dislike <script> when its used to solve a problem that should be
solved in some more elegant way.  Replacing and "_" with a ".", besides
<replaceregexp> (which isn't available in a released version yet) is
perfectly cool with me.

Also, post 1.4.1 release a modification was made to <script> so that
"project" can be used instead of "<project name>".  It makes having
re-usable script blocks among build files with different project names
possible.  (And I am responsible for that change, thank you very much!)

    Erik


----- Original Message -----
From: "Diane Holt" <holtdl@yahoo.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Monday, March 04, 2002 5:06 PM
Subject: Re: String translation/regex


> --- Mark Derricutt <mark@talios.com> wrote:
> > I have a property thats set to "5.0.019" for a version number, but cvs
> > tags don't allow .'s, is there a way to do a regex and change all
> > the .'s to _'s  from ant?
>
> Or if you don't want to deal with reading and writing a file (and want to
> see Erik cringe :) --
>
>   <property name="version" value="5.0.019"/>
>
>   <target name="setTag">
>   <script language="javascript"> <![CDATA[
>     cvstag = projname.getProperty("version").replace('.', '_');
>     projname.setProperty("cvstag", cvstag);
>     ]]></script>
>     <echo message="cvstag  = ${cvstag}"/>
>   </target>
>
> Diane
>
> =====
> (holtdl@yahoo.com)
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - sign up for Fantasy Baseball
> http://sports.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message