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" <[EMAIL PROTECTED]>
To: "Ant Users List" <[EMAIL PROTECTED]>
Sent: Monday, March 04, 2002 5:06 PM
Subject: Re: String translation/regex
> --- Mark Derricutt <[EMAIL PROTECTED]> 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
>
> =====
> ([EMAIL PROTECTED])
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - sign up for Fantasy Baseball
> http://sports.yahoo.com
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>