On Tue, 20 Jan 2004, Mitch Denny <[EMAIL PROTECTED]> wrote:

> It is, in fact I spoke to Ian about it last week and he pointed me
> at your blog entries on the subject.

Which are certainly not the full story.

> Can you recall the justifications made for the element?

The Ant and NAnt communities have different takes on some issues, in
particular Anters don't like anything "scripty" in their build files
while "scripty" stuff is a first class citizen in NAnt, so not all
reasons for <macrodef> in Ant may apply to Ant.

When Peter Reilly suggested <macrodef> and it cousin <presetdef> I
didn't understand its potential imediately, I thought it was just
syntactic sugar - but I've been utterly wrong.

It turns out that in a lot of our users' build files a single task or
a combination of tasks has to be invoked repeatedly with different
combinations of parameters.  As I'm just feeling my way into C# right
now (don't ask) I think that this will become even more true in a .NET
environment where I'll need one <csc> task per assembly I want to
create as opposed to a single <javac> task in Java land with its 1:1
mapping of public classes and files.

So what do you do in NAnt if you want to execute the same <csc> task
for ten assemblies - the exactly same configuration of the task itself
but only the assembly name and the set of source files changes?

In Ant 1.5.x you could (1) Copy'n'Paste, (2) use <script> and be
called a herectic or (3) use <antcall> which is an incredibly heavy
operation in Ant - NAnt may or may not be different.

Ant 1.6 also added <import>.  You can now write a library build file
that defines macros for complex combinations of tasks. This means that
<macrodef> can be used to improve build file snippet reuse by
encapsulating and even hiding parts of the build logic.

There may be other pros for the tasks, but the above has convinced me
to view this task together with <import> as the most important feature
of Ant 1.6.

Cheers

        Stefan

-- 
http://stefanbodewig.blogger.de/


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to