On Monday 19 May 2003 10:01, Jose Alberto Fernandez wrote:
> > From: peter reilly [mailto:[EMAIL PROTECTED]
> >
> > On Saturday 17 May 2003 19:59, Costin Manolache wrote:
> > > I think <taskdef> should be treated as a special <typedef>
> >
> > with TaskAdapter
> >
> > > as adapter.
> > >
> > > ( i.e. use <typedef> as the main definition mechanism, and
> >
> > taskdef as
> >
> > > a shortcut for types with optional TaskAdapter adapters ).
> >
> > This is exacty what "taskdef" is in the patch :-).  It derives
> > from typedef and sets the adapterClass to TaskAdapter, and
> > the adaptoClass
> > to Task. The html page for taskdef in the friday patch makes
> > this explicit.
> >
> > I have some WorkInProgress code to allow this to be specified
> > in a buildfile.
> >
> > <extendtype name="taskdef">
> >     <typedef adapter="org.apache.tools.ant.TaskAdapter"
> >                   adaptto="org.apache.tools.ant.Task"/>
> > </extendtype>
> >
> > "extendtype" is a WIP name for a cut-down templating feature, it
> > defines new types from other types with some attributes pre set.
>
> Well I am glad, you guys are rediscovering "role" definitions
> one feature at the time. :-)

Yes... the extendtype idea does come from your antlib proposal.

I have WIP code that adds roles into my patch.

They are used like:

<typedef name="or" role="org.apache.tools.ant.taskdefs.condition.Condition"
              classname="org.apache.tools.ant.taskdefs.condition.Or"/>

This definition of "or" can only be used where "o.a.t.a.t.condition.Condition"
is expected. - either in a add[Configured](o.a.t.a.t.condition.Condition)
method, or in a add[Configured]Nested(o.a.t.a.t.condition.Condition) with
the polymorhic <nested poly:type="or"/> build script.

<extendtype/> may be used to emulate the "role" element in the antlib
proposal:

  <extendtype name="conditiondef">
      <typedef role="org.apache.tools.ant.taskdefs.condition.Condition"/>
  </extendtype>

<conditiondef name="or" classname="o.a.t.a.taskdefs.condition.Or"/>

Peter

Reply via email to