ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Agnew" <br...@oopsconsultancy.com>
Subject Re: AW: AW: Passing data between 2 created tasks
Date Mon, 30 Apr 2007 08:05:39 GMT
Hi -

1) Makes sense
2) I'm looking at client issues with using <xmltask>, so a different task
is  not much use here.
3) Yes. That was the conclusion I'd come to. I just wanted to make sure
that I was seeing expected behaviour in Ant before I implemented a
work-around.

Thx for your response,

Brian

On Mon, April 30, 2007 06:43, Jan.Materne@rzf.fin-nrw.de wrote:
> That behaviour wont change as it's intended to have a "clean" project
> instance.
>
> 1. Think about the use of <antcall>. Because it initializes a new Project
> there
>    is much overhead. You could avoid that using <macrodef>.
>
> 2. I havent used that, but maybe <antcontrib:antcallback> could help.
>
> 3. If you can serialize your data object, your 2nd task could read that
>    serialized data.
>
>
> Jan
>
>>-----Urspr√ľngliche Nachricht-----
>>Von: Brian Agnew [mailto:brian@oopsconsultancy.com]
>>Gesendet: Samstag, 28. April 2007 13:29
>>An: Ant Users List
>>Betreff: Re: AW: Passing data between 2 created tasks
>>
>>A quick experiment with Ant 1.6.5 suggests that this doesn't work with
>><antcall>. e.g. in the below
>>
>><antcall target="A">
>>   TaskB...
>></antcall>
>>
>><target name="A">
>>   TaskA
>></target>
>>
>>wouldn't work, since the <antcall> results in a different Project
>>object. Is there a workaround in this scenario ?
>>
>>Brian
>>
>>Jan.Materne@rzf.fin-nrw.de wrote:
>>> Store your Stack as reference on the project
>>>
>>> TaskA {
>>>     public static final String STACKNAME = "someprefix.stack";
>>>     Stack stack;
>>>
>>>     public execute() {
>>>         ...
>>>         getProject().addReference(STACKNAME, stack);
>>>     }
>>> }
>>>
>>> TaskB {
>>>     public execute() {
>>>         Stack stack =
>>(Stack)getProject().getReference(TaskA.STACKNAME);
>>>         ...
>>>     }
>>> }
>>>
>>>
>>>
>>> Jan
>>>
>>>
>>> ________________________________
>>>
>>> 	Von: Farhdine Boutzakhti [mailto:farhdine.boutzakhti@calyon.com]
>>>
>>> 	Gesendet: Mittwoch, 24. Januar 2007 16:41
>>> 	An: dev@ant.apache.org; user@ant.apache.org
>>> 	Betreff: Passing data between 2 created tasks
>>>
>>>
>>>
>>> 	Hi list,
>>>
>>>
>>>
>>> 	I am creating 2 different tasks with ANT:
>>>
>>> 	A - One extracting some data in a stack from a cache,
>>>
>>> 	B - One inserting these data in a database.
>>>
>>>
>>>
>>> 	I want to know if there is a way to pass an object (i.e. a
>>> stack) from A to B?
>>>
>>>
>>>
>>> 	Thanks !
>>>
>>> 	Farhdine.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>
>>--
>>Brian Agnew                  http://www.oopsconsultancy.com
>>OOPS Consultancy Ltd         brian @ oopsconsultancy.com
>>Tel: +44 (0)7720 397526
>>Fax: +44 (0)20 8682 0012
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message