You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Peter Donald <do...@apache.org> on 2001/06/10 08:12:27 UTC
Generic vs non-generic?
Hi,
I was wondering on which was thought to be more useful.
<typedef name="javac" type="task" classname="org.apache.ant.Javac">
vs
<taskdef name="javac" classname="org.apache.ant.Javac">
The first part is more powerful and seems to be the trend that all features
of ant move towards (ie see Copy* --> Copy). The second is nicer for less
technical sophisticated audience but could lead to a whole bunch of tasks
(aspectdef/listenerdef/datadef/taskdef/mapperdef/etc).
They same issue comes up import style statements
<import library="jdk.tsk" name="javac" type="task"/>
vs
<import-task library="jdk.tsk" name="javac"/>
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*
Re: Generic vs non-generic?
Posted by Stefan Bodewig <bo...@apache.org>.
Peter Donald <do...@apache.org> wrote:
> I was wondering on which was thought to be more useful.
>
> <typedef name="javac" type="task" classname="org.apache.ant.Javac">
>
> vs
>
> <taskdef name="javac" classname="org.apache.ant.Javac">
Making up some preference syntax here
<typedef name="taskdef" type="task"
classname="org.apache.ant.core.Typedef" />
<pref name="taskdef">
<attribute name="type" default="task" />
</pref>
which means, one could make <taskdef> a specialized version of
<typedef> quite easily. I'd go for the first version.
Stefan