ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: Roles (was: antlib)
Date Tue, 29 Apr 2003 10:02:00 GMT
On Tuesday 29 April 2003 10:46, Jose Alberto Fernandez wrote:
> > If you don't want <if> to be useable as a condition - don't make it
> > implement condition.
>
> It sounds very nice, but the reality is that <if> already exists and has
> existed for a long time. Hence we can not go and change it just because
> it does not fit the pattern you would like. Heck, it is not even our code
> and there is a BC contract we need to fulfill.

"if" is defined using <taskdef/>. This places a TaskAdaptor around
the class (as the class does not extend TaskDef). So it does not get
matched to the add(Condition) method in my local build of ant.

The if task had to extend ConditionBase to get the condtions, with the
new proposal it could just something like:

   private ConditionBase conditions;
   public void add(Condition condition) {
       conditions.add(condition);
   }


In any case there will always be cases where both proposals will
fail ;-)

Peter.

Mime
View raw message