ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles Scokart" <gscok...@gmail.com>
Subject RE: "ant call trigger can only be used from an ant build" from ant build
Date Thu, 10 May 2007 14:11:46 GMT
Personally I prefer the abstract doExecute and the final execute because it
make it clear which code is executed before and after the task.  I fear that
an event handler registered to the project will not be so clear.



Gilles

> -----Original Message-----
> From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> Sent: jeudi 10 mai 2007 15:23
> To: ivy-user@incubator.apache.org; J.Wypychowski@icm.edu.pl
> Subject: Re: "ant call trigger can only be used from an ant build" from
> ant build
> 
> On 5/10/07, Xavier Hanin <xavier.hanin@gmail.com> wrote:
> >
> > There is however a slight problem - this makes the API incompatible with
> > > 2.0.0-alpha-1. It is possible to make doExecute not abstract in
> IvyTask
> > > and therefore validate all the other tasks that are kept by people,
> but
> > > this can lead to hard to find errors.
> >
> >
> > breaking the API is not a major problem, Ivy 2.0 is already breaking a
> lot
> > of API, and we named our last release alpha because it is still subject
> to
> > API break (I tihnk we warn users against that in the release notes). So
> I
> > prefer having things like this, we may even declare execute final to
> make
> > sure it isn't overridden improperly. I'll review your patch soon and
> apply
> > it.
> >
> 
> I may have found another way of doing things before and after the task is
> executed without breaking the API and the conventions when writing ant
> task.
> Indeed Ant fire events before starting a task and after finishing it (see
> the perform method). So we may register as a listener of the project in
> the
> init method of IvyTask, then push on task started and pop on task
> finished.
> Each task would be responsible for its own events only.
> The drawback of this approach is that if someone calls execute directly (a
> public method) instead of perform, we won't get the correct context. This
> is
> not what programs are supposed to do, so I don't know if it's really a
> problem or not (I realize I usually call execute instead of perform, which
> is not a good thing :-( ).
> 
> So, what do you think?
> 
> Xavier
> 
> Xavier
> >
> > Best Regards.
> > >
> > > --jw
> > >
> > > --
> > > Jaroslaw Wypychowski
> > > Interdyscyplinarne Centrum Modelowania Matematycznego i Komputerowego
> UW
> > >
> > > jarwyp@icm.edu.pl
> > >
> > >
> >
> >
> > --
> > Xavier Hanin - Independent Java Consultant
> > Manage your dependencies with Ivy!
> > http://incubator.apache.org/ivy/
> >
> 
> 
> 
> --
> Xavier Hanin - Independent Java Consultant
> Manage your dependencies with Ivy!
> http://incubator.apache.org/ivy/


Mime
View raw message