You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Nico Seessle <ni...@seessle.de> on 2000/09/20 11:34:32 UTC
Ant-Extension-Mechanism - Step 1
Before I go further I wanted to know if the following format for
Ant-Extension files (generated with the TaskLib-Task) is acceptable for you
all?
It currently will only support dynamic loading of task, no checking for
other required libs and so on.
As others suggested the usage of special ClassLoaders introduced in JDK 1.2+
and/or the usage of MANIFEST.MF, I just dropped these ideas, because (1) we
need to implement different behaviour depending of the JVM used (if we do it
our own we can always do the same) and (2) I don't think you can easyly (and
in a readable way) use MANIFEST.MF to do other things in the furure (check
for required libs and so on) - this must be why there is a WEB.XML instead
just using MANIFEST.MF :-)
Nico
Re: Ant-Extension-Mechanism - Step 1
Posted by Peter Donald <do...@mad.scientist.com>.
At 01:06 20/9/00 +0200, you wrote:
> CM> but I am curous as to why the servlet spec uses WEB-INF for wars?
>
>Especially since servlet containers must hide META-INF directories if
>they exist as well.
>
>I guess they wanted to physically separate the information about the
>JAR itself (everything with regard to signing the JAR for example)
>from the information about the web application contained.
It's more because WARs are only meant as deployment packages. ie you drop a
war into right place and it is installed. It can be installed to any place
(tomcat unzips it in same directory) and during this installation the
WEB-INF is not unpacked as it is specific to jar and not the "package"
Cheers,
Pete
*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power." |
| -Abraham Lincoln |
*------------------------------------------------------*
Re: Ant-Extension-Mechanism - Step 1
Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "CM" == Conor MacNeill <co...@m64.com> writes:
CM> Nico, I have had a quick look at your post and I have a few
CM> questions.
I haven't even found the time for this, sorry.
CM> A task along the lines of Stefan's war tsk may be more
CM> appropriate. It doesn't try to build the deployment descriptor -
CM> it just assembles the war from a set of distributed pieces.
I was tempted to automate writing the deployment descriptor as well
(and if it only was to shorten the syntax). I've made it the way it is,
because I didn't want to add numerous nested elements to the task just
to duplicate a structure that could as well be written out
directly. I.e. I came to the same conclusion as you.
CM> but I am curous as to why the servlet spec uses WEB-INF for wars?
Especially since servlet containers must hide META-INF directories if
they exist as well.
I guess they wanted to physically separate the information about the
JAR itself (everything with regard to signing the JAR for example)
from the information about the web application contained.
Stefan
RE: Ant-Extension-Mechanism - Step 1
Posted by Conor MacNeill <co...@m64.com>.
Nico,
I have had a quick look at your post and I have a few questions.
I wonder if there is much advantage building a task library in ths way? Why
not just write the xml file directly and build a jar with it. It seems we
are writing some xml in an ant build file and then processing that into
different, but similar xml, for a task library. I'm not sure of the
advantages of that. Have I missed something? A task along the lines of
Stefan's war tsk may be more appropriate. It doesn't try to build the
deployment descriptor - it just assembles the war from a set of distributed
pieces.
You have put the deployment descriptor (I think that is a reasonable term
for this file) in META-INF. That is entirely reasonable but I am curous as
to why the servlet spec uses WEB-INF for wars?
Cheers
Conor
> -----Original Message-----
> From: Nico Seessle [mailto:nico@seessle.de]
> Sent: Wednesday, 20 September 2000 20:38
> To: ant-dev@jakarta.apache.org
> Subject: Re: Ant-Extension-Mechanism - Step 1
>
>
> ----- Original Message -----
> From: "Nico Seessle" <ni...@seessle.de>
> To: <an...@jakarta.apache.org>
> Sent: Wednesday, September 20, 2000 11:34 AM
> Subject: Ant-Extension-Mechanism - Step 1
>
>
> > Before I go further I wanted to know if the following format for
> > Ant-Extension files (generated with the TaskLib-Task) is acceptable for
> you
> > all?
> >
> > It currently will only support dynamic loading of task, no checking for
> > other required libs and so on.
> >
> Since there are no docs - you can use it like this:
>
> <target name="default">
> <tasklib name="MSVSS-Lib"
> version="1.0"
> home="http://jakarta.apache.org/ant"
> jarfile="vsstest.zip">
> <fileset dir="jakarta-ant/classes/"/>
> <task name="vssget"
>
> classname="org.apache.tools.ant.taskdefs.optional.msvss.MSVSSGET"
> version="1.0"/>
> <task name="vsshistory"
>
> classname="org.apache.tools.ant.taskdefs.optional.msvss.MSVSSHistory"
> version="1.0"/>
> <task name="vsslabel"
>
> classname="org.apache.tools.ant.taskdefs.optional.msvss.MSVSSLabel"
> version="1.0"/>
> </tasklib>
>
> Nico
>
>
Re: Ant-Extension-Mechanism - Step 1
Posted by Nico Seessle <ni...@seessle.de>.
----- Original Message -----
From: "Nico Seessle" <ni...@seessle.de>
To: <an...@jakarta.apache.org>
Sent: Wednesday, September 20, 2000 11:34 AM
Subject: Ant-Extension-Mechanism - Step 1
> Before I go further I wanted to know if the following format for
> Ant-Extension files (generated with the TaskLib-Task) is acceptable for
you
> all?
>
> It currently will only support dynamic loading of task, no checking for
> other required libs and so on.
>
Since there are no docs - you can use it like this:
<target name="default">
<tasklib name="MSVSS-Lib"
version="1.0"
home="http://jakarta.apache.org/ant"
jarfile="vsstest.zip">
<fileset dir="jakarta-ant/classes/"/>
<task name="vssget"
classname="org.apache.tools.ant.taskdefs.optional.msvss.MSVSSGET"
version="1.0"/>
<task name="vsshistory"
classname="org.apache.tools.ant.taskdefs.optional.msvss.MSVSSHistory"
version="1.0"/>
<task name="vsslabel"
classname="org.apache.tools.ant.taskdefs.optional.msvss.MSVSSLabel"
version="1.0"/>
</tasklib>
Nico
Re: Ant-Extension-Mechanism - Step 1
Posted by Nico Seessle <ni...@seessle.de>.
----- Original Message -----
From: "Peter Donald" <do...@mad.scientist.com>
To: <an...@jakarta.apache.org>
Sent: Wednesday, September 20, 2000 12:58 PM
Subject: Re: Ant-Extension-Mechanism - Step 1
> * you implement your own outputter - is that just so you can use any
> arbitary xml-parser ?
Much simpler... I copied that part from XmlLogger.java :-)
> * There is no way to include task documentation. As yet Ant doesn't have
> any standard format thou I assume in future it will go to a stylebook type
> formaty and thus it would be nice to do something like
>
And one could add something like description="" to tasks so one could do
ant -listtasks to show what tasks are available to ant and what they may do
for you.
I don't know if it is better to make this mechanism do "all we can need at
once" or just start with a "simple" extension-machanism and add other
features later? The first will possibly not make it into Ant 1.2 as people
are crying for a release, the second one could do it.
Nico
Re: Ant-Extension-Mechanism - Step 1
Posted by Peter Donald <do...@mad.scientist.com>.
Hi,
At 11:34 20/9/00 +0200, you wrote:
>Before I go further I wanted to know if the following format for
>Ant-Extension files (generated with the TaskLib-Task) is acceptable for you
>all?
>
>It currently will only support dynamic loading of task, no checking for
>other required libs and so on.
>
>As others suggested the usage of special ClassLoaders introduced in JDK 1.2+
>and/or the usage of MANIFEST.MF, I just dropped these ideas, because (1) we
>need to implement different behaviour depending of the JVM used (if we do it
>our own we can always do the same) and (2) I don't think you can easyly (and
>in a readable way) use MANIFEST.MF to do other things in the furure (check
>for required libs and so on) - this must be why there is a WEB.XML instead
>just using MANIFEST.MF :-)
It looks good for what it does
* you implement your own outputter - is that just so you can use any
arbitary xml-parser ?
* There is no way to include task documentation. As yet Ant doesn't have
any standard format thou I assume in future it will go to a stylebook type
formaty and thus it would be nice to do something like
ant --install-task myTask.tsk
and that would copy out xml or html fragments so you could read about the
tasks instead of guessing what the tasklib contains. It may even be
possible to include DTD or Schema fragments for those who want them ????
other than that I like :P
Cheers,
Pete
*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power." |
| -Abraham Lincoln |
*------------------------------------------------------*
RE: Ant-Extensions, step 0 [was: Ant-Extension-Mechanism - Step 1]
Posted by Paul Philion <ph...@acmerocket.com>.
Conor (and all) -
The real world has intruded on my available "open source" time. And (of
course) my "simple little fixes" turned out to be a little more complex than
I expected. And I want to get good docs in place about writing plug-ins.
So my plug-in mods aren't ready yet.
I would like to see the current features (including all the new fileset
stuff) get formally released in the very near term.
- Paul Philion
-----Original Message-----
From: Conor MacNeill [mailto:conor@m64.com]
Sent: Thursday, September 21, 2000 9:30 AM
To: ant-dev@jakarta.apache.org
Subject: RE: Ant-Extensions, step 0 [was: Ant-Extension-Mechanism - Step
1]
> -----Original Message-----
> From: Paul Philion [mailto:philion@acmerocket.com]
> Sent: Thursday, 21 September 2000 0:31
> To: ant-dev@jakarta.apache.org
> Subject: Ant-Extensions, step 0 [was: Ant-Extension-Mechanism - Step 1]
>
>
> Greetings -
>
>
> Comments? Should I send out the code for people to try themselves?
> Should this go into a short-term branch just to test it?
>
> - Paul
>
Paul,
I would like to see a patch posted so we can see the code and then kick it
around a bit. There may be some feedback before we adopt what would be a
major change in the way ant works.
Conor
RE: Ant-Extensions, step 0 [was: Ant-Extension-Mechanism - Step 1]
Posted by Conor MacNeill <co...@m64.com>.
> -----Original Message-----
> From: Paul Philion [mailto:philion@acmerocket.com]
> Sent: Thursday, 21 September 2000 0:31
> To: ant-dev@jakarta.apache.org
> Subject: Ant-Extensions, step 0 [was: Ant-Extension-Mechanism - Step 1]
>
>
> Greetings -
>
>
> Comments? Should I send out the code for people to try themselves?
> Should this go into a short-term branch just to test it?
>
> - Paul
>
Paul,
I would like to see a patch posted so we can see the code and then kick it
around a bit. There may be some feedback before we adopt what would be a
major change in the way ant works.
Conor
Ant-Extensions, step 0 [was: Ant-Extension-Mechanism - Step 1]
Posted by Paul Philion <ph...@acmerocket.com>.
Greetings -
I've recently (early this morning) completed the first attempt at the
"TaskLoader". It will provides the following capabilities:
- load JARs from a "plugin" directory
- grab a "meta-inf/plugin.xml" file from each JAR
- parse the XML into tasks descriptions
- act as a class loader for tasks (from it's specific JAR)
It is not perfect yet (there are some minor changes I want to make,
and currently it only supports 1.2 class loading), but I think I can
have it in good shape in short order.
The "plugin" directory and XML file name are all very flexible, so
those can be named what ever people want. The impact to existing code
is small: One new class (TaskLoader) and a few minor changes to
Project, including rewriting createTask to use TaskLoader.
The bigger changes are to the build process itself. I would like to
separate all the standard tasks into a "tasks.jar" plugin, separate
from the "ant.jar" (which should contain only the core ant classes and
minimal [or no!] tasks). The dist target will also be impacted, as
I'll need to get the plugin dir created and the plugin JARs copied
into it.
Comments? Should I send out the code for people to try themselves?
Should this go into a short-term branch just to test it?
- Paul
> -----Original Message-----
> From: Nico Seessle [mailto:nico@seessle.de]
> Sent: Wednesday, September 20, 2000 5:35 AM
> To: ant-dev@jakarta.apache.org
> Subject: Ant-Extension-Mechanism - Step 1
>
>
> Before I go further I wanted to know if the following format for
> Ant-Extension files (generated with the TaskLib-Task) is
> acceptable for you
> all?
>
> It currently will only support dynamic loading of task, no
> checking for
> other required libs and so on.
>
> As others suggested the usage of special ClassLoaders
> introduced in JDK 1.2+
> and/or the usage of MANIFEST.MF, I just dropped these
> ideas, because (1) we
> need to implement different behaviour depending of the JVM
> used (if we do it
> our own we can always do the same) and (2) I don't think
> you can easyly (and
> in a readable way) use MANIFEST.MF to do other things in
> the furure (check
> for required libs and so on) - this must be why there is a
> WEB.XML instead
> just using MANIFEST.MF :-)
>
> Nico
>
>