ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From emount...@amadeus.net
Subject Re: dollar signs in replace commands
Date Fri, 23 Jun 2000 17:00:36 GMT
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(ProjectHelper.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