ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Retrieving values from task?
Date Tue, 03 Apr 2001 17:04:17 GMT


i think what Stefan was referring to was to have your task set an ant
property internally.  then when your script needs the value from the task,
that value can be referenced as any other ant property would.  such as:

in your custom task code:

this.getProject().setProperty("task1.propertyName", valueThatAntNeeds);

in your build.xml:

<task1 ... />
<task2 value="${task1.propertyName}" />

so now ${task1.propertyName} would be set with the value from task1, which
is essentially the getProperty() call that you want.


Stephen Champeau <>> on 04/03/2001
11:37:15 AM

Please respond to

Sent by:  "Stephen Champeau" <>

To:   <>

Subject:  RE: Retrieving values from task?


Thanks for your reply.

I'm afraid I was a bit vague. What I'm really after is the ability of the
ant xml script to retrieve a value from the task, rather than the script
setting the property of the task. In other words I need the script to be
able to call some sort of "getProperty()" on a task.


-----Original Message-----
From: Stefan Bodewig []
Sent: Monday, April 02, 2001 11:45 PM
Subject: Re: Retrieving values from task?

Stephen Champeau <> wrote:

> I have built several tasks that manage the build number of my
> project. I would now like to retrieve and use this build number from
> within my ant script. Is there any way to do this?

Make them set a property.


View raw message