ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31999] - Easier way to declare externally-written tasks in build script
Date Mon, 22 Nov 2004 18:20:17 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31999>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31999





------- Additional Comments From kk@kohsuke.org  2004-11-22 19:20 -------


Thank you for your comment, Matt.

> Next, if all antlib.xml files existed at the same resource location it would
> make retrieving them much more difficult than a simple getResource call because
> you'd have to look in every jar.  Having antlib URLs allows the construction of
> different locations for antlib.xml and puts the task of finding the appropriate
> resource onto the JVM.  It also means you can (if you wanted to) bundle multiple
> antlibs into a single archive.

Loading resources from the same location is a well established practice in Java,
and JVM allows you to enumerate all the resources given a ClassLoader. While it
does make the code in Ant bit longer, but that's not a significant complication.



> Next you propose that the task writer define the namespace uri.  I'm no expert
> on XML namespace theory but at the very least you could say that if two tasks
> were defined by their respective authors to live in the same uri with the same
> taskname (not entirely improbable) the innocent user might have trouble using
> the competing tasks together.

I've been a member of a few XML related WGs/TCs in W3C/OASIS, so I know
a thing or two about XML namspaces. The point of using the namespace URI is to
make it almost impossible to have unexpected collisions.

So I can say that this will never be a problem. As an example,
think about taglib. You are not allowed to have two taglibs in the same URI,
but this has never been an issue.


> As for simplicity, I most often use the <project xmlns:foo="antlib:org.foo">
> approach.  Having the user declare the namespace is not unreasonable and I
> expect shields us from numerous bug reports by virtue of requiring that the user
> know what he or she is doing.

I agree that asking the user to declare the namespace is not unreasonable.
Indeed in my proposal, the user would have to declare the namespace.

The problem that I'm having with xmlns:foo="antlib:org.foo" is that it requires
task classes to be available as a part of the current user's settings
(such as $ANT_HOME/lib and a few other places, as you kindly pointed out)

This makes it impossible to tell people to "cvs co and then ant" -- they have
to now update their own environment to include my task jars. This is more
complicated than I'd prefer.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message