ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <adammurdoch...@yahoo.com>
Subject RE: Name collisions
Date Mon, 04 Mar 2002 11:57:54 GMT


> -----Original Message-----
> From: Jose Alberto Fernandez [mailto:j_a_fernandez@yahoo.com]
> Sent: Monday, 4 March 2002 6:30 PM
> To: Ant Developers List
> Subject: Re: Name collisions
> 

> > The type-name should be usable on its own, unless it is 
> ambiguous.  In the cases where it is 
> > ambiguous, the build file writer needs to be able to tell us 
> explicitly which one they mean to use.  > Some options:
> > 
> 
> So what happens if I just do:
>     <typedef name="A" ... />
>     ...
>     <taskdef name="A" ... />
> 

I imagine that types declared like this, would be added to a 'default' antlib, for the purposes
of name resolution.  The default antlib would have an empty name, or maybe the same name as
the project.

So the above is fine, given that {antlib, role, type-name} is used for uniqueness.  If {antlib,
type-name} is being used, well, you're in trouble.  Easy enough for the build file writer
to fix, though.


> not from a library but from an on the fly definition (like when 
> one compiles and uses the task on the same build.
> 
> > * Have the ability to alias a type when imported.
> > 
> >   <import lib="lib1">
> >     <task name="copy" alias="copy1"/>
> >   </import>
> > 
> >   <copy>
> >   <copy1>
> > 
> 
> You can do this in <antlib> but the point is what does the system 
> should do if you do not
> do that.
> 

That's easy enough: Use an ambiguous name, the build fails.  We need to figure out whether
we either prevent any possibility of ambiguous names, or whether we want to give the build
file writer a way to explicitly reference a type, when there is more than one alternative
with the same shortname.


Adam


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


Mime
View raw message