You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Stirling, Scott" <sc...@workscape.com> on 2004/01/30 23:04:26 UTC

presetdef vs. macrodef

Hi,

I sort of get some of the differences between <presetdef> and <macrodef>, but I don't understand the motivation behind <presetdef>.  Can anyone explain why <presetdef> exists when we have <macrodef>?  It seems like they overlap, if <macrodef> doesn't actually subsume everything that <presetdef> can do.  Not knowing how the two came into existence, I don't understand the motivation, and am unsure why/when I should use <presetdef>.

Thank you,
Scott Stirling
Workscape

***********************************************************************
This message is intended only for the use of the intended recipient and
may contain information that is PRIVILEGED and/or CONFIDENTIAL.  If you
are not the intended recipient, you are hereby notified that any use,
dissemination, disclosure or copying of this communication is strictly
prohibited.  If you have received this communication in error, please
destroy all copies of this message and its attachments and notify us
immediately.
***********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: presetdef vs. macrodef

Posted by Matt Benson <gu...@yahoo.com>.
I have played with, and like, both... <presetdef> is,
IMO, simpler to use but more limited... one use of
<presetdef> I think is interesting:  I have an antlib
that consists of several <presetdef>s of the <apply>
task with a particular executable and certain <arg>
elements set for each.  So in this case I got six
custom tasks for < 10 lines of XML each, with nested
filesets and up-to-date checking using nested
mappers...

Another interesting thing is that once you have
aliased a task using either <macrodef> or <presetdef>
it doesn't matter which it was, if they look
similar... see
http://nagoya.apache.org/wiki/apachewiki.cgi?NewAntFeaturesInDetail/PresetDef
for a simple example of what I'm talking about.

-Matt

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org