Thanks for the perspective. 

<quote source="Stefan">
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. 
</quote>

I'm seeing this already in my build scripts, and I suspect that build
scripts could be simplified significantly by doing something similar to
Nant. In our case we can do the <taskdef /> element and simply do the
<include /> to suck in the definitions, it works like a charm on the
modified build I have.

I am currently working on the property scoping mechanism. Believe it or
not this is actually a harder change because I need to create a property
dictionary (in my current implementation approach) for every scope. Then
have a front end lookup (so its transparent) to search all the
dictionaries in a tree. Interesting stuff actually.

----------------------------------------
- Mitch Denny
- [EMAIL PROTECTED]
- http://www.monash.net
- +61 (414) 610141
-  
 
-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 21 January 2004 9:06 AM
To: Mitch Denny
Cc: [EMAIL PROTECTED]
Subject: Re: [nant-dev] Idea: Inline task definitions (task
orchestration/macros).

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