ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darrell DeBoer <>
Subject Re: [myrmidon] Type Librarys
Date Wed, 08 May 2002 12:12:29 GMT

On Wed, 8 May 2002 19:43, Peter Donald wrote:
> On Mon, 6 May 2002 22:53, Darrell DeBoer wrote:
> > On Mon, 6 May 2002 20:30, Peter Donald wrote:
> > 1) Types/TypeLibs can be registered under a namespace, which *may* be
> > taken from the AntlibDescriptor (say, an AntLib name attribute), but can
> > also be specified in other ways (eg <typelib library="ant1compat"
> > namespace="ant1"/>)
> I would prefer it to be based on the name of the antlib (ie internal name
> specified in manifest). I suppose we could support aliasing but I would
> like the importing to be very obvious that it is aliasing that is occuring.
> Maybe something like
> <typelib library="ant1compat" namespace-alias="ant1"/>

This is (almost) exactly how it now works:
<typelib library="ant1compat" namespace="ant1"/>

Maybe we can default to use the antlib name if available, where namespace 
isn't specified. Currently, the default/empty namespace ("") would be used 
where the namespace wasn't defined. The empty namespace means that these 
types, once hidden, can't be accessed by FQNames.

> > 3) When a TypeFactory is requested from the TypeManager, the name used
> > can be fully qualified (has a namespace), or not. A fully-qualified name
> > requests a named type registered under a particular namespace, whereas an
> > unqualified name involves searching all namespaces for the type name. If
> > the name cannot be resolved unambiguously within the context, an error
> > occurs.
> Sounds good. Basically this is the same way as imports are handled in java
> yes?

similar, yes.

> > 4) The core antlibs (ant/lib/*) will be registered under an antlib name,
> +1

Currently under a hardcoded "ant" namespace - marked as "todo".

> > 4a) Perhaps types explicitly type-def'd (not an entire library, a single
> > type), would be considered higher precedence again, above <import>ed
> > library types.
> +1


> > Question:
> > Is it appropriate to use XML namespaces for ant type namespaces?
> It has been -1'ed before due to complexity and extra cruft that it adds. We
> could still use ":" as separator but type resolution should follow the java
> import tules which I believe what you propose does ;) However I would
> prefer "."

Me too - and that's how it is. As long as we're aware that this means that 
Type names cannot include '.'. Converter classname is munged in the 
ConverterDefinition into a type name. (SInce converter names are never 
exposed it doesn't really matter what they look like internally)

My next step is to get the Ant1Compat stuff working again, to write an 
Ant1TargetTask, and to change the transforming project builder to do nothing 
more than add the following to the top of Ant1 build files.
<typelib library="ant1compat" namespace="ant1"/>
That will be cool...


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message