You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Scott Stirling <ss...@allaire.com> on 2000/12/16 05:29:29 UTC

[ PROPOSAL ] Ant taglib

Hey,

The subject says a lot.  What I'm proposing here is an addition to the
taglib project.

I have a few of the easy tags implemented as prototypes all ready, namely:

<ant:echo message=""/>
<ant:fail message=""/>
<ant:gunzip src="/path/to/file.gz" dest="[ filename | directory ]"/>
<ant:gzip src="/path/to/file" zipfile="filename.zip"/>
<ant:mkdir dir="/directory(ies)/to/create"/>

So why the hell make a taglib out of Ant tasks, you ask?  I've thought about
it a lot.  The main reason I've thought of is that so many of the Ant tasks
make natural JSP tags that would allow people with Web scripting skills to
do a lot of the same mundane backend stuff that CFML tags do, that PERL
programmers scripts do, etc. such as copy files, delete files, ftp files,
execute native programs, and so on.  

Being able to build and deploy ejb jars and wars online would allow you to
easily make Web-based build systems.

Ant is a Jakarta project, and much of the task code from Ant could be
re-used.  So far I've written JSP tags that follow the semantics and
functionality of the Ant tasks, but throwing JspTagExceptions in place of
BuildExceptions, logging to ServletContext.log() and completely isolating
the individual tasks from the whole back end Ant build system with its
Project class and all its dependencies.

Since the Ant tasks would all be implemented as JSP tags, they could be
mixed with presentation tags, with scripting languages (via the BSF taglib),
and so on.

There are two main ways to do this that I've thought about, the latter of
which would depend on some cooperation/interaction with the Ant dev group:

1. Implement all the tasks as regular JSP tags in a taglib, capable of being
used in isolation (i.e., being able to use any task without having to nest
it in a project tag, or without requiring a Project to be instantiated,
etc.), just like any old tag.  Naturally some tags would be dependent on
each other, like fileset and include tags inside of the tags like copy and
javac.

2. Integrate the taglib with the Ant build system so that a build.xml could
(essentially) be run as a JSP page by simply changing its file extension to
.jsp, adding the appropriate taglib directive at the top and adding a tag
prefix to the XML tags.  This is pie in the sky, but an interesting goal, I
think.  And if Ant had a nice clean interface API for us, it would be easy
to tie into the whole Ant system from an app server without doing something
kludgey like using a Runtime.exec() or instantiating Ant's main() method.
Such an interface could also help with goal #1 above, allowing Ant tasks to
be instantiated as standalone entities (perhaps having Tags that implemented
an Ant Task interface).

I guess that's it.  I've been thinking about this for a couple weeks.  I
wanted to have more of the tags done before proposing this, but I really
wanted to get it off my chest.  I'd like to pursue this as an open source
project under the Jakarta Taglib project if you'll vote for it.

Best regards,

Scott Stirling
West Newton, MA

Re: [ PROPOSAL ] Ant taglib

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
Scott Stirling wrote:
> 
> Hey,
> 
> The subject says a lot.  What I'm proposing here is an addition to the
> taglib project.
> [...]
> There are two main ways to do this that I've thought about, the latter of
> which would depend on some cooperation/interaction with the Ant dev group:
> [...]
> 1. Implement all the tasks as regular JSP tags in a taglib, capable of being
> used in isolation (i.e., being able to use any task without having to nest
> it in a project tag, or without requiring a Project to be instantiated,
> etc.), just like any old tag.  Naturally some tags would be dependent on
> each other, like fileset and include tags inside of the tags like copy and
> javac.
> 
> 2. Integrate the taglib with the Ant build system so that a build.xml could
> (essentially) be run as a JSP page by simply changing its file extension to
> .jsp, adding the appropriate taglib directive at the top and adding a tag
> prefix to the XML tags.  This is pie in the sky, but an interesting goal, I
> think.  And if Ant had a nice clean interface API for us, it would be easy
> to tie into the whole Ant system from an app server without doing something
> kludgey like using a Runtime.exec() or instantiating Ant's main() method.
> Such an interface could also help with goal #1 above, allowing Ant tasks to
> be instantiated as standalone entities (perhaps having Tags that implemented
> an Ant Task interface).

Isn't there a third alternative, extending 2) a bit:

3) Make *one* custom action that provides the Ant environment and processes
   regular Ant elements, specified as is in the custom action body (or reads
   them from a build.xml file specified by an attribute).

If that's possible (and AFAIK, it should be), you can automatically use
new Ant elements as soon as they are developed, without having to first
wrap them in tag handler code.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

Re: [ PROPOSAL ] Ant taglib

Posted by Glenn Nielsen <gl...@voyager.apg.more.net>.
Scott Stirling wrote:
> 
> Hey,
> 
> The subject says a lot.  What I'm proposing here is an addition to the
> taglib project.
> 
> I have a few of the easy tags implemented as prototypes all ready, namely:
> 
> <ant:echo message=""/>
> <ant:fail message=""/>
> <ant:gunzip src="/path/to/file.gz" dest="[ filename | directory ]"/>
> <ant:gzip src="/path/to/file" zipfile="filename.zip"/>
> <ant:mkdir dir="/directory(ies)/to/create"/>
> 
> So why the hell make a taglib out of Ant tasks, you ask?  I've thought about
> it a lot.  The main reason I've thought of is that so many of the Ant tasks
> make natural JSP tags that would allow people with Web scripting skills to
> do a lot of the same mundane backend stuff that CFML tags do, that PERL
> programmers scripts do, etc. such as copy files, delete files, ftp files,
> execute native programs, and so on.
> 
> Being able to build and deploy ejb jars and wars online would allow you to
> easily make Web-based build systems.
> 
> Ant is a Jakarta project, and much of the task code from Ant could be
> re-used.  So far I've written JSP tags that follow the semantics and
> functionality of the Ant tasks, but throwing JspTagExceptions in place of
> BuildExceptions, logging to ServletContext.log() and completely isolating
> the individual tasks from the whole back end Ant build system with its
> Project class and all its dependencies.
> 
> Since the Ant tasks would all be implemented as JSP tags, they could be
> mixed with presentation tags, with scripting languages (via the BSF taglib),
> and so on.
> 
> There are two main ways to do this that I've thought about, the latter of
> which would depend on some cooperation/interaction with the Ant dev group:
> 
> 1. Implement all the tasks as regular JSP tags in a taglib, capable of being
> used in isolation (i.e., being able to use any task without having to nest
> it in a project tag, or without requiring a Project to be instantiated,
> etc.), just like any old tag.  Naturally some tags would be dependent on
> each other, like fileset and include tags inside of the tags like copy and
> javac.
> 

+1 for this alternative

Although I wince a bit thinking about JSP page publishers using an Ant taglib.
Just another reason to run Tomcat with the Java SecurityManager enabled.

> 
> I guess that's it.  I've been thinking about this for a couple weeks.  I
> wanted to have more of the tags done before proposing this, but I really
> wanted to get it off my chest.  I'd like to pursue this as an open source
> project under the Jakarta Taglib project if you'll vote for it.
> 
> Best regards,
> 
> Scott Stirling
> West Newton, MA

-- 
----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Re: [ PROPOSAL ] Ant taglib

Posted by Serge Knystautas <se...@lokitech.com>.
----- Original Message -----
From: "Scott Stirling" <ss...@allaire.com>


> The subject says a lot.  What I'm proposing here is an addition to the
> taglib project.
>
> I have a few of the easy tags implemented as prototypes all ready, namely:
>
> <ant:echo message=""/>
> <ant:fail message=""/>
> <ant:gunzip src="/path/to/file.gz" dest="[ filename | directory ]"/>
> <ant:gzip src="/path/to/file" zipfile="filename.zip"/>
> <ant:mkdir dir="/directory(ies)/to/create"/>

+1. Sounds like a very clever way to repurpose a great set of utils.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/


Re: [ PROPOSAL ] Ant taglib

Posted by Eduardo Pelegri-Llopart <Ed...@eng.sun.com>.
+1 too.  This type of experimentation is one of the things I wanted to
encourage with taglibs.

What about the other direction?  Running the JSP (compiler) from Ant so
we can build static sites using JSPs?  I like the way Velocity is
integrated with Ant and would love to see it done with JSP too.

Of course, once you have both sides you can build static sites
dynamically :-)

	- eduard/o


"Craig R. McClanahan" wrote:
> 
> Scott Stirling wrote:
> 
> > Hey,
> >
> > The subject says a lot.  What I'm proposing here is an addition to the
> > taglib project.
> >
> > I have a few of the easy tags implemented as prototypes all ready, namely:
> >
> > <ant:echo message=""/>
> > <ant:fail message=""/>
> > <ant:gunzip src="/path/to/file.gz" dest="[ filename | directory ]"/>
> > <ant:gzip src="/path/to/file" zipfile="filename.zip"/>
> > <ant:mkdir dir="/directory(ies)/to/create"/>
> >
> > So why the hell make a taglib out of Ant tasks, you ask?  I've thought about
> > it a lot.  The main reason I've thought of is that so many of the Ant tasks
> > make natural JSP tags that would allow people with Web scripting skills to
> > do a lot of the same mundane backend stuff that CFML tags do, that PERL
> > programmers scripts do, etc. such as copy files, delete files, ftp files,
> > execute native programs, and so on.
> >
> > Being able to build and deploy ejb jars and wars online would allow you to
> > easily make Web-based build systems.
> >
> 
> +1 ... this idea is mind-twisting enough to be a lot of fun :-).
> 
> >
> > Scott Stirling
> > West Newton, MA
> 
> Craig

Re: [ PROPOSAL ] Ant taglib

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Scott Stirling wrote:

> Hey,
>
> The subject says a lot.  What I'm proposing here is an addition to the
> taglib project.
>
> I have a few of the easy tags implemented as prototypes all ready, namely:
>
> <ant:echo message=""/>
> <ant:fail message=""/>
> <ant:gunzip src="/path/to/file.gz" dest="[ filename | directory ]"/>
> <ant:gzip src="/path/to/file" zipfile="filename.zip"/>
> <ant:mkdir dir="/directory(ies)/to/create"/>
>
> So why the hell make a taglib out of Ant tasks, you ask?  I've thought about
> it a lot.  The main reason I've thought of is that so many of the Ant tasks
> make natural JSP tags that would allow people with Web scripting skills to
> do a lot of the same mundane backend stuff that CFML tags do, that PERL
> programmers scripts do, etc. such as copy files, delete files, ftp files,
> execute native programs, and so on.
>
> Being able to build and deploy ejb jars and wars online would allow you to
> easily make Web-based build systems.
>

+1 ... this idea is mind-twisting enough to be a lot of fun :-).


>
> Scott Stirling
> West Newton, MA

Craig



RE: [ PROPOSAL ] Ant taglib

Posted by Scott Stirling <ss...@mediaone.net>.
Thank you, Mike.  I'd be glad to receive your assistance.

Anyone else care to comment either way?

I know it's the weekend.  I myself am going up to my mother's in New
Hampshire for an early Christmas this afternoon.  I'll be back on Monday.
Look forward to further comments next week.

Scott Stirling
West Newton, MA
(BTW, for those who don't know me (and I don't expect any of you do) I work
on JRun at Allaire, and I wrote several chapters of a book on JSP for Ben
Forta and SAMS publishing)


-----Original Message-----
From: Mike Cannon-Brookes [mailto:mcannon@internet.com]
Sent: Saturday, December 16, 2000 1:38 AM
To: taglibs-dev@jakarta.apache.org
Subject: RE: [ PROPOSAL ] Ant taglib


Scott,

I for one think this is a fantastic idea. I already have hacked up versions
of many of the ant tags for personal use (file manipulation mainly, along
with CVS).

Using Ant code for these instead of my own poor attempts is a very smart
idea, I can't believe I didn't think of it sooner ;)

Count me as a +1 for this taglib, I'll even lend a hand if you want.

Mike

Technical Director, Asia Pacific
internet.com - mcannon@internet.com

> -----Original Message-----
> From: Scott Stirling [mailto:sstirling@allaire.com]
> Sent: Saturday, December 16, 2000 3:29 PM
> To: 'taglibs-dev@jakarta.apache.org '
> Subject: [ PROPOSAL ] Ant taglib
>
>
> Hey,
>
> The subject says a lot.  What I'm proposing here is an addition to the
> taglib project.
>
> I have a few of the easy tags implemented as prototypes all ready, namely:
>
> <ant:echo message=""/>
> <ant:fail message=""/>
> <ant:gunzip src="/path/to/file.gz" dest="[ filename | directory ]"/>
> <ant:gzip src="/path/to/file" zipfile="filename.zip"/>
> <ant:mkdir dir="/directory(ies)/to/create"/>
>
> So why the hell make a taglib out of Ant tasks, you ask?  I've
> thought about
> it a lot.  The main reason I've thought of is that so many of the
> Ant tasks
> make natural JSP tags that would allow people with Web scripting skills to
> do a lot of the same mundane backend stuff that CFML tags do, that PERL
> programmers scripts do, etc. such as copy files, delete files, ftp files,
> execute native programs, and so on.
>
> Being able to build and deploy ejb jars and wars online would allow you to
> easily make Web-based build systems.
>
> Ant is a Jakarta project, and much of the task code from Ant could be
> re-used.  So far I've written JSP tags that follow the semantics and
> functionality of the Ant tasks, but throwing JspTagExceptions in place of
> BuildExceptions, logging to ServletContext.log() and completely isolating
> the individual tasks from the whole back end Ant build system with its
> Project class and all its dependencies.
>
> Since the Ant tasks would all be implemented as JSP tags, they could be
> mixed with presentation tags, with scripting languages (via the
> BSF taglib),
> and so on.
>
> There are two main ways to do this that I've thought about, the latter of
> which would depend on some cooperation/interaction with the Ant dev group:
>
> 1. Implement all the tasks as regular JSP tags in a taglib,
> capable of being
> used in isolation (i.e., being able to use any task without having to nest
> it in a project tag, or without requiring a Project to be instantiated,
> etc.), just like any old tag.  Naturally some tags would be dependent on
> each other, like fileset and include tags inside of the tags like copy and
> javac.
>
> 2. Integrate the taglib with the Ant build system so that a
> build.xml could
> (essentially) be run as a JSP page by simply changing its file
> extension to
> .jsp, adding the appropriate taglib directive at the top and adding a tag
> prefix to the XML tags.  This is pie in the sky, but an
> interesting goal, I
> think.  And if Ant had a nice clean interface API for us, it would be easy
> to tie into the whole Ant system from an app server without doing
> something
> kludgey like using a Runtime.exec() or instantiating Ant's main() method.
> Such an interface could also help with goal #1 above, allowing
> Ant tasks to
> be instantiated as standalone entities (perhaps having Tags that
> implemented
> an Ant Task interface).
>
> I guess that's it.  I've been thinking about this for a couple weeks.  I
> wanted to have more of the tags done before proposing this, but I really
> wanted to get it off my chest.  I'd like to pursue this as an open source
> project under the Jakarta Taglib project if you'll vote for it.
>
> Best regards,
>
> Scott Stirling
> West Newton, MA


RE: [ PROPOSAL ] Ant taglib

Posted by Mike Cannon-Brookes <mc...@internet.com>.
Scott,

I for one think this is a fantastic idea. I already have hacked up versions
of many of the ant tags for personal use (file manipulation mainly, along
with CVS).

Using Ant code for these instead of my own poor attempts is a very smart
idea, I can't believe I didn't think of it sooner ;)

Count me as a +1 for this taglib, I'll even lend a hand if you want.

Mike

Technical Director, Asia Pacific
internet.com - mcannon@internet.com

> -----Original Message-----
> From: Scott Stirling [mailto:sstirling@allaire.com]
> Sent: Saturday, December 16, 2000 3:29 PM
> To: 'taglibs-dev@jakarta.apache.org '
> Subject: [ PROPOSAL ] Ant taglib
>
>
> Hey,
>
> The subject says a lot.  What I'm proposing here is an addition to the
> taglib project.
>
> I have a few of the easy tags implemented as prototypes all ready, namely:
>
> <ant:echo message=""/>
> <ant:fail message=""/>
> <ant:gunzip src="/path/to/file.gz" dest="[ filename | directory ]"/>
> <ant:gzip src="/path/to/file" zipfile="filename.zip"/>
> <ant:mkdir dir="/directory(ies)/to/create"/>
>
> So why the hell make a taglib out of Ant tasks, you ask?  I've
> thought about
> it a lot.  The main reason I've thought of is that so many of the
> Ant tasks
> make natural JSP tags that would allow people with Web scripting skills to
> do a lot of the same mundane backend stuff that CFML tags do, that PERL
> programmers scripts do, etc. such as copy files, delete files, ftp files,
> execute native programs, and so on.
>
> Being able to build and deploy ejb jars and wars online would allow you to
> easily make Web-based build systems.
>
> Ant is a Jakarta project, and much of the task code from Ant could be
> re-used.  So far I've written JSP tags that follow the semantics and
> functionality of the Ant tasks, but throwing JspTagExceptions in place of
> BuildExceptions, logging to ServletContext.log() and completely isolating
> the individual tasks from the whole back end Ant build system with its
> Project class and all its dependencies.
>
> Since the Ant tasks would all be implemented as JSP tags, they could be
> mixed with presentation tags, with scripting languages (via the
> BSF taglib),
> and so on.
>
> There are two main ways to do this that I've thought about, the latter of
> which would depend on some cooperation/interaction with the Ant dev group:
>
> 1. Implement all the tasks as regular JSP tags in a taglib,
> capable of being
> used in isolation (i.e., being able to use any task without having to nest
> it in a project tag, or without requiring a Project to be instantiated,
> etc.), just like any old tag.  Naturally some tags would be dependent on
> each other, like fileset and include tags inside of the tags like copy and
> javac.
>
> 2. Integrate the taglib with the Ant build system so that a
> build.xml could
> (essentially) be run as a JSP page by simply changing its file
> extension to
> .jsp, adding the appropriate taglib directive at the top and adding a tag
> prefix to the XML tags.  This is pie in the sky, but an
> interesting goal, I
> think.  And if Ant had a nice clean interface API for us, it would be easy
> to tie into the whole Ant system from an app server without doing
> something
> kludgey like using a Runtime.exec() or instantiating Ant's main() method.
> Such an interface could also help with goal #1 above, allowing
> Ant tasks to
> be instantiated as standalone entities (perhaps having Tags that
> implemented
> an Ant Task interface).
>
> I guess that's it.  I've been thinking about this for a couple weeks.  I
> wanted to have more of the tags done before proposing this, but I really
> wanted to get it off my chest.  I'd like to pursue this as an open source
> project under the Jakarta Taglib project if you'll vote for it.
>
> Best regards,
>
> Scott Stirling
> West Newton, MA