ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Ruby" <ru...@us.ibm.com>
Subject Re: PROPOSAL: loading tasks from jars for Ant 1.5
Date Wed, 10 Oct 2001 16:30:29 GMT
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.

> 2. Alter Project.java to discontinue the use of the defaults.properties
> files, and instead do a ClassLoader.getResources("meta-inf/antlib.xml"),
and
> process each of those on startup.

Note: getResources is JDK 1.2.  Is is the Ant community ready to make that
leap just yet?

I am not familar enough with this method, and the documentation is vague
enough.  If there are multiple jar entries on your classpath, with the
standard system class loader find all of them?

> 3. Add a new task "antlib" which can be used to load a jar file
containing
> ant tasks and datatypes.  This would be used in case someone doesn't want
to
> drop their antlib into $ANT_HOME/lib.
>
> e.g.
>   <antlib file="foo.jar"/>

Count me in those that don't want to drop jars into $ANT_HOME/lib.

Shouldn't antlib accept a Path specification?  I'd also like it to respect
the value of build.sysclasspath.

> 4. Separate the definition of the optional tasks and types into the
> meta-fin/antlib.xml file in the optional.jar.

typo: meta-inf.

> Please reply with your +1, 0, or -1 vote to the group.

Can I wait for answers to the above first?  ;-)

I don't know if it can be addressed at the same time, but as more projects
define tasks for their own use, one thing to consider is adding the ability
to define tasks which are built during the build process.  Perhaps an
antlib task could allow nested javac and jar elements.  The javac tasks
would simply be executed in order.  The jar tasks would not only execute
but the results would be added to the path.

- Sam Ruby


Mime
View raw message