Jose Alberto answered that one indirectly. I know understand that the
<macrodef> I had does not declare a 'name' or 'classname' attribute, and
thus could not be used as I wrote it, whereas <presetdef> keeps access to
all attributes of the preset'd type. Sorry for being so slow ;-) --DD

> -----Original Message-----
> From: Dominique Devienne [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 14, 2003 11:44 AM
> To: 'Ant Developers List'
> Subject: RE: [new tasks] presetdef and macrodef
> 
> > -----Original Message-----
> > From: peter reilly [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, August 14, 2003 11:22 AM
> > To: Ant Developers List
> > Subject: Re: [new tasks] presetdef and macrodef
> >
> > It is not a sub-set of <macrodef/>. But there is a lot of overlap of
> > functionality. In fact after I got embeded elements to work for
> > <macrodef/>,
> > I replaced most uses of <presetdef/> with <macrodef/>.
> >
> > I think however that there is a place for <presetdef/> For example
> > if you look at the current code of TaskDef, all it consists of is
> > setting two properties. This can be expressed using <presetdef/> as
> >
> > <presetdef name="taskdef">
> >     <typedef adaptor="org.apache.tools.ant.task.TaskAdaptor"
> >                       adaptto="org.apache.tools.ant.task.Task"/>
> > </presetdef>
> >
> > When (if) roles are introducted, one implementation would be
> > to add a "role" or "restrict" attribute to <typedef>.
> >
> >   <typedef name="or"
> >         classname="org.apache.tools.ant.taskdefs.conditions.Or"
> >         restrict="org.apache.tools.ant.taskdefs.conditions.Condition"/>
> >
> >   <typedef name="or"
> >         classname="org.apache.tools.ant.types.selectors.Or"
> >         restrict="org.apache.tools.ant.types.selectors.FileSelector"/>
> >
> > one could use <presetdef/> as
> >    <presetdef name="conditiondef">
> >        <typedef
> >
> restrict="org.apache.tools.ant.taskdefs.conditions.Condition"/>
> >     </presetdef>
> >
> > and define:
> >     <conditiondef name="or"
> >            classname="org.apache.tools.ant.taskdefs.conditions.Or"/>
> 
> OK, I clearly misunderstood <presetdef>... But then, you can also write:
> 
> <macrodef name="conditiondef">
>   <typedef restrict="org.apache.tools.ant.taskdefs.conditions.Condition"/>
> </macrodef>
> 
> and still do,
> 
> <conditiondef name="or"
>               classname="org.apache.tools.ant.taskdefs.conditions.Or"/>
> 
> Can't you? So what's exactly the difference between <presetdef> and
> <macrodef>??? I still don't get it I'm afraid...

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to