ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Import in Antlibs (Re: [new tasks] presetdef and macrodef)
Date Tue, 26 Aug 2003 08:50:00 GMT

Gus Heck wrote, On 25/08/2003 18.02:
> Nicola Ken Barozzi wrote:
> 
>> Jose Alberto Fernandez wrote, On 22/08/2003 14.58:
>>
>>>> From: Gus Heck [mailto:gus-antdev@cognition.olin.edu] 
>> ...
>>
>>>> If macro definitions are available to sub builds, then your 3rd case 
>>>> might occur, but I don't think it would be good to allow macros to 
>>>> be called across build file boundaries. builds would be almost 
>>>> unintelligible without tracking down the macros from other files.
>>>
>>> This is all regular kosher ANT stuff, up to this day, <taskdef/>s get
>>> inherited, they do not need to be redeclared for the task to be
>>> available during the <antcall/>. 
>> ...
>>> We already have a solution for the case of <taskdef> I would just like
>>> the behavior on both cases to be the same, so to reduce the leaarning
>>> curve.
>>
>> What about making them part of antlibs too?
>>
> How does a macro defined in the build become an antlib?

The easiest way is to make it possible for antlibs to contain buildfiles 
that are imported.

Antlibs would thus be jars that contain tasks, typedefs, and buildfiles.
When loaded, the taskdefs are called, the typedefs too, and the 
buildfile is imported.

This is what we do in Centipede, and it works ATM quite well, as we are 
able to thus to create antlibs easily even without any java code, only 
by including a buildfile.

The alternative would be to allow only special buildfile snippets that 
contain macrodefs, that is to check that there are only macrodefs and 
import that file.

What do others think?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



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


Mime
View raw message