I see your proposal as two additional tasks:
1) A task that creates the descriptor from the javadoc information. The
result is the XML file.
2) A task similar to <war> that simplifies creating the jar with the
correct content in it. Which we should provide no matter what. This task may
also provide a way to define the descriptor in-line. something like:
<antar file="mylib.jar" .... >
<descriptor>
<task name="xyz" class="c.p.q" />
....
</descriptor>
</antar>
optionaly you could say the descriptor comes from a file which could be
produced by (1) above.
Jose Alberto
----- Original Message -----
From: "Steve Loughran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2001 8:30 PM
Subject: Re: PROPOSAL: loading tasks from jars for Ant 1.5
>
> ----- Original Message -----
> From: "Sam Ruby" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 10, 2001 09:30
> Subject: Re: PROPOSAL: loading tasks from jars for Ant 1.5
>
>
> > Tim Dawson wrote:
> >
> > > In summary of the previous thread the recommendation is this:
> > >
> > > 1. Specify a deployment descriptor for an antlib jar. This would reside
> > in
> > > "meta-inf/antlib.xml" and have a simple structure:
> > >
> > > <antlib version="1.0">
> > > <task name="..." class="..."/>
> > > <task name="..." class="..."/>
> > > <datatype name="..." class="..."/>
> > > <datatype name="..." class="..."/>
> > > </antlib>
> >
> > Simple enough.
>
>
> There are a couple of things I would like to be possible with this
> mechanism.
>
> 1. the deployment descriptor can be generated automatically from doc
> comments using the xdoclet tasks (see xdoclet.sourceforge.net). We could
> then add doc comments at the top of the class which were pulled out to
> generate the deplyment descriptor, and the docs.
>
> /**
> Task to reboot the system
> @ant:task reboot
> @since 1.6
> @author me
> */
>
> public class Reboot extends Task {
>
> }
>
> /**
> @ant:datatype Time
> */
>
> public class SomeTime {
> }
>
> This probably isnt that hard; just needs an xdoclet template and someone to
> go through all the existing tasks adding the markup. A couple of hours work.
>
>
> 2. At some time in the distant future it could be possible (albeit not
> mandatory) to also describe which attributes/elements were accessible. some
> doc comments could go in to do that
>
> @ant:attribute optional
> @ant:attribute required
>
> This could be used for a number of purposes
> a) autogeneration of a better DTD, one which included #REQUIRED where it
> was
> b) better validation of task declarations in a build file
> c) part of a means of tying in javadoc and manual documentation
>
>
> For this to actually be used for validation would need big changes in ant,
> and I am not proposing it takes place any time soon. But for documentation
> and DTD it would be nice and viable today.
>
> If the deployment descriptor is going to ever support a more rigorous
> declaration of allowed attributes, then there may some design decisions
> which need to go in now. Other than a version indicator I dont see any.
>
> 3. Other things that should go in the descriptor
>
> -minimum ant version supported
> -home page of tasklib
> -comment text
> -tasklib URI
> -tasklib version
>
> The ant version lets the loader not load something into a version of ant
> which is too old to support it.
>
> Home page and comment text provide information for users
>
> tasklib URI and versions are placeholders for any more dynamic loading
> system that someone cares to implement in the very far future. e.g.
>
> <antlib uri="nap:Moby+Porcelin" version="1.3"
> repository="http://tasklibs.org" />
>
>
> I'm willing to help with the doc comments/xdoclet side of things.
>
> -steve
>
>
>
>
>
>
>
>
>