Java Mailing List Archive

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

Apache Ant Archive

» Ant Users List
» Ant Developers List
Ant task with nested property problem

Ant task with nested property problem

2003-03-17       - By Yaron Ruckenstein

Hi,

I have two Ant scripts that both except to get the property "param.project"
thought the command line, and one of them is calling the other, in the
following way:

<ant antfile="v:\bin\compile.xml" target="compile" inheritAll="false">
  <property name="param.project" value="${current.project}"/>
</ant>

(I'm using ant1.5.2 with jdk1.4.1_01, and this problem occurs inside a foreach
loop).

My problem is that the value that is passed to the called ant file is not the
value of ${current.project}, instead the calling script value is passed.

I know that property is not a variable, and once it is set, it cannot be
changed,
but in this context I was excepting the value that is passed to the called
script
to be updated.

What can I do to solve my problem and get the values that I want passed ?

(I suppose I can change the names of the properties that the called script
excepts,
but then, will I be able to call it more that once? if the nested property
serves as
any other property task, then once it is set, it cannot be changed)

Thanks in advance,
Yaron



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