ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: Interfacing with Ant in JSP
Date Thu, 11 Jan 2001 03:00:30 GMT
At 09:46  10/1/01 -0500, Scott Stirling wrote:
>Hello,
>
>Basic idea is this: a JSP tag library that re-uses the Ant "task library."

welcome to my world - these are the sorts of things I have been partially
doing with a fork of Ant from ages back. I don't use JSP but I assume it is
a similar use case.


>1. Make all (give or take a few) of the Ant tasks available as stand-alone
>JSP custom actions (no Project context required), 

Unfortunately we can't for Ant1.x for backwards compatability reasons but
thats precisely the thing I advocated ages ago when I first joined the ant
list - it was ignored then because it was so different but hopefully now I
have it in the myrmidon proposal it may get in ;)

>converting Ant behaviors
>to JSP behaviors where appropriate. Examples of changes to make Ant tasks
>more like JSP tags are 1) output stream handling -- either JspWriter or
>ServletContext.log() instead of System.out, 

Again this abstraction is done in myrmidon proposal via Logger abstraction.

>and 2) throwing JspTagExceptions
>in places where an Ant task would throw a BuildException.

I am not sure this is the right thing to do. Are JspTagExceptions
RuntimeExceptions or just normal exceptions ?

>Examples of changes that make the tasks work as standalone custom actions
>are 1) there is no need for a full Ant <project> or even a <target> in order
>to use the tasks as individual tags, 

again - have a look at myrmidon - it does that. The tasks don't know where
they are running. Some setups will be running in a cron-server, some in
ant-project,  others in instalshield - and now still more in jsp pages ;)

>and 2) task-tags can take sub-tags
>where appropriate, such as <property> or <fileset> elements.

Have it implemented in myrmidon but I didn't check it in because it is
those evil if/else tags but I can check it in if you want ?

>2. Interface with the full Ant capabilities via JSP, i.e., full Projects. In
>this case you may be able to take a build.xml file and enclose it in a JSP
>custom action, or generate (or modify) one on the fly, dynamically or
>statically include it from an external source, and so on.

right.

>So I'm fishing for ideas.  I've thought of using reflection, of figuring out
>what's the minimum Project context that needs to be provided for tasks to be
>executed, and I've thought about waiting until Ant 2.0, when perhaps a very
>clean interface from external client apps would be in place.

Well have a look at mymidon. It is somewhat cleaner now than it used to be
and is based on Avalon framework. Theres minimal documentation and minimal
tasks but it should be able to do what you want. If not we can change it ;)

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message