ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <>
Subject the Ant task
Date Tue, 07 Aug 2001 17:10:08 GMT
In looking for a way to return values from one target to it's calling
target, I was looking that the Ant task. I noticed, it's very feasible
to do this, providing you can gain access to the project that the target
is run under (the variable "p1" in the Ant class).  However, this variable
1) private, which means you can't get at it outside the class, period.. and
2) is automatically nulled out when after the target runs.

If this project was available to another task, then one could simply look in
the project for particular named variables, and copy these variables 
into the
current project.  I have actually done this, but rather than work with a 
Ant, i just copied the Ant and CallTarget classes, and modified them to 
do this.
The syntax i came up with looks much like a standard "antcall", except 
for the
addition of a new subelement "returnvalue", which specifies 
property(ies) which
will be copied back to the current project.

<call target="sometarget">
  <param name="x" value="y" />

  <returnvalue name="return.value" />

any of the ant-dev team have opinions on the possibility of patching Ant to
allow for this?  I'm not suggesting CallTarget support this, but rather 
optional task could be the one to take advantage of it.

Matt Inger (
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 

View raw message