ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@m64.com>
Subject RE: dollar signs in replace commands
Date Sat, 24 Jun 2000 15:16:36 GMT
OK,

I've fixed this. One error was caused by a $ at the end of a property value.
The other is because ProjectHelper.replaceProperties is called twice on the
value being set - once in ProjectHelper.configure and again in
Property.init. I removed the call in Property.init.

Conor

--
Conor MacNeill
Home: conor@m64.com
Work: conor@cortexebusiness.com.au
Web:  www.cortexebusiness.com.au


> -----Original Message-----
> From: emountain@amadeus.net [mailto:emountain@amadeus.net]
> Sent: Saturday, 24 June 2000 3:01
> To: ant-dev@jakarta.apache.org
> Subject: Re: dollar signs in replace commands
>
>
> Except that if you do:
>
> <property name="var1" value="$$a" />
> <property name="var2" value="${var1}+somethingelse" />
> <echo message="${var1},${var2}" />
>
> you won't get what you expect...  and if you remove the "a" from
> "$$a" you will
> even get:
>
> BUILD CONFIG ERROR
>
> java.lang.StringIndexOutOfBoundsException: String index out of range: 1
>         at org.apache.tools.ant.taskdefs.Property.init(Property.java:126)
>         at
> org.apache.tools.ant.ProjectHelper$TaskHandler.init(ProjectHelper.
> java:332)
>         at
> org.apache.tools.ant.ProjectHelper$TargetHandler.startElement(Proj
> ectHelper.java:311)
>
>         at com.sun.xml.parser.Parser.maybeElement(Parser.java:1391)
>         at com.sun.xml.parser.Parser.content(Parser.java:1499)
>         at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>         at com.sun.xml.parser.Parser.content(Parser.java:1499)
>         at com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
>         at com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
>         at com.sun.xml.parser.Parser.parse(Parser.java:284)
>         at
> org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:104)
>         at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:86)
>         at org.apache.tools.ant.Main.runBuild(Main.java:228)
>         at org.apache.tools.ant.Main.main(Main.java:191)
>
> (All this with a copy of ANT taken from CVS a week or so ago....)
>
> Cheers,
> :E
>
>
>
>
>
>
> From: Stefan Bodewig <bodewig@bost.de>  on 23/06/2000 15:10 GMT
>
> Please respond to ant-dev@jakarta.apache.org
>
>
>
>
>
>
>
>
> |--------->
> |         |
> |--------->
>
> >-----------------------------------------------------------------
> ---------->
>   |
>             |
>
> >-----------------------------------------------------------------
> ---------->
>   >-------------------------------------------|
>   |                                           |
>   >-------------------------------------------|
> |--------->
> |To:      |
> |--------->
>
> >-----------------------------------------------------------------
> ---------->
>   |ant-dev@jakarta.apache.org
>             |
>
> >-----------------------------------------------------------------
> ---------->
>   >-------------------------------------------|
>   |                                           |
>   |                                           |
>   >-------------------------------------------|
> |--------->
> |cc:      |
> |--------->
>
> >-----------------------------------------------------------------
> ---------->
>   | (bcc: Eric Mountain/NCE/AMADEUS)
>             |
>
> >-----------------------------------------------------------------
> ---------->
>   >-------------------------------------------|
>   |                                           |
>   |                                           |
>   >-------------------------------------------|
> |--------->
> |         |
> |--------->
>
> >-----------------------------------------------------------------
> ---------->
>   |
>             |
>
> >-----------------------------------------------------------------
> ---------->
>   >-------------------------------------------|
>   |                                           |
>   >-------------------------------------------|
> |--------->
> |Subject: |
> |--------->
>
> >-----------------------------------------------------------------
> ---------->
>   |Re: dollar signs in replace commands
>             |
>
> >-----------------------------------------------------------------
> ---------->
>   >-------------------------------------------|
>   |                                           |
>   >-------------------------------------------|
>
>
>
>
>
>
>
> >>>>> "SB" == Stuart Barlow <sbarlow@peopledoc.com> writes:
>
>  SB> Is there any way that I can get ant to recognise as literal
>  SB> strings?
>
> I'm not sure I've understood your problem. If you need a literal $
> inside your build.xml write it as $$.
>
> Does this help?
>
> Stefan
>
>
>
>


Mime
View raw message