You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jon Stevens <jo...@latchkey.com> on 2000/11/11 21:15:46 UTC

beanshell

hey all,

i'm new to the list, but i have actually got some of my code in Ant so i'm
not new to Ant by any means.

Since i'm new to the list, i'm not sure what sort of discussion has already
happened around adding BeanShell support to Ant. Can anyone catch me up real
quick?

<http://www.beanshell.org/>

If no discussion has happened, I would like to propose that we add BeanShell
support to Ant. What I would like to do is essentially use BeanShell as a
replacement for the complex .sh/.bat files that we have to use to go along
with execution of Ant.

Ant and BeanShell essentially overlap in functionality quite a bit, so, I'm
not really proposing even making a BeanShell Task, although I think that
might be a good idea in the future for people who might want to execute
their stuff as BeanShell Script vs. Ant .xml syntax.

The real problem that I'm having now is that the .sh and .bat files are a
real pain in the ass to manage and are not easily re-usable and I would like
to move the code that is in those files off to something that is a bit more
cross platform portable, like BeanShell.

Essentially, we could replace 99% of what is in the .sh and .bat files with
something like this:

<http://www.beanshell.org/manual/execscripts.html>

Where the contents of the .sh and .bat files would then be "ported" over to
BeanShellScript language.

I'm also willing to spend some 2am coding time on working on this as this is
a real problem for me...

Comments? Flames? Suggestions?

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/


Re: beanshell

Posted by Jon Stevens <jo...@latchkey.com>.
on 11/13/2000 12:40 AM, "Stefan Bodewig" <bo...@bost.de> wrote:

> Jon Stevens <jo...@latchkey.com> wrote:
> 
>> i'm new to the list, but i have actually got some of my code in Ant
>> so i'm not new to Ant by any means.
> 
> welcome back, Jon. You are even still a committer as far as I can
> tell.

yep! thanks!

> None specific to BeanShell IIRC. We do have scripting support through
> BSF and it should be possible to support BeanShell through this as a
> scripting task. But this is not what you are heading to.

Right.

> BTW, BeanShell is LGPL, right? I know you have more experience with
> ASL versus GPL (WebMacro) and that you as well as Brian are in contact
> with the FSF to resolve this, but it still looks as if there was
> trouble ahead.

LGPL is not an issue as long as we are not distributing changed source code.
If we are simply distributing an unmodified .jar, there shouldn't be any
problems.

>> What I would like to do is essentially use BeanShell as a
>> replacement for the complex .sh/.bat files that we have to use to go
>> along with execution of Ant.
> 
> Which .sh/.bat files are you referring to?
> 
> The starter scripts for Ant itself? I don't think they are doing too
> much that could be done in Java, basically working on environment
> variables, which BeanShell couldn't do either.
> 
> The antRun scripts? In JDK 1.3 we don't use them at all, likewise on
> Windows NT/2000, MacOS and OS/2 they don't get used. I can easily
> imagine modifying org.apache.tools.ant.taskdefs.Execute to use
> BeanShell instead of antRun if it present.
> 
> In general I think we should support BeanShell (like through BSF),
> make use of it (like in Execute) but not rely on it, i.e. allow the
> users to use Ant without installing BeanShell - the starter scripts
> are not that complicated at all.

Right, the starter scripts are not that complicated at all _anymore_. I
guess my real problem is that I feel like I'm creating and working with a
million of them and I want to make it easier. :-)

Christopher's email was a great one and should help me out quite a bit.

thanks,

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/



Re: beanshell

Posted by Stefan Bodewig <bo...@bost.de>.
Jon Stevens <jo...@latchkey.com> wrote:

> i'm new to the list, but i have actually got some of my code in Ant
> so i'm not new to Ant by any means.

welcome back, Jon. You are even still a committer as far as I can
tell.

> Since i'm new to the list, i'm not sure what sort of discussion has
> already happened around adding BeanShell support to Ant.

None specific to BeanShell IIRC. We do have scripting support through
BSF and it should be possible to support BeanShell through this as a
scripting task. But this is not what you are heading to.

BTW, BeanShell is LGPL, right? I know you have more experience with
ASL versus GPL (WebMacro) and that you as well as Brian are in contact
with the FSF to resolve this, but it still looks as if there was
trouble ahead.

> What I would like to do is essentially use BeanShell as a
> replacement for the complex .sh/.bat files that we have to use to go
> along with execution of Ant.

Which .sh/.bat files are you referring to?

The starter scripts for Ant itself? I don't think they are doing too
much that could be done in Java, basically working on environment
variables, which BeanShell couldn't do either.

The antRun scripts? In JDK 1.3 we don't use them at all, likewise on
Windows NT/2000, MacOS and OS/2 they don't get used. I can easily
imagine modifying org.apache.tools.ant.taskdefs.Execute to use
BeanShell instead of antRun if it present.

In general I think we should support BeanShell (like through BSF),
make use of it (like in Execute) but not rely on it, i.e. allow the
users to use Ant without installing BeanShell - the starter scripts
are not that complicated at all.

Cheers

Stefan

Re: beanshell

Posted by James Duncan Davidson <du...@x180.com>.
On 11/11/00 12:15 PM, "Jon Stevens" <jo...@latchkey.com> wrote:

> If no discussion has happened, I would like to propose that we add BeanShell
> support to Ant. What I would like to do is essentially use BeanShell as a
> replacement for the complex .sh/.bat files that we have to use to go along
> with execution of Ant.

I'd go for beanshell support in addition to the .sh/.bat files. By no means
do we want to require beanshell to run ant.

But along these lines, one of the things I'd like to see for Ant 2.0 is
better support for whatever os your on. For example, a Ant.app package for
Mac OS X that would launch a GUI would rock. :)

-- 
James Duncan Davidson                                        duncan@x180.com
                                                                  !try; do()


Re: beanshell

Posted by Peter Donald <do...@apache.org>.
At 12:50  14/11/00 -0800, you wrote:
>on 11/11/2000 7:40 PM, "Conor MacNeill" <co...@m64.com> wrote:
>
>> Jon,
>> 
>> beanshell looks cool. Are you referring to the ant .bat/.sh files
>> themselves or to .bat/.sh files that are invoked from an ant build?
>> 
>> Conor
>
>Hi Conor,
>
>You seem to be the ONLY person who actually read my entire email. I was
>referring to the .bat/.sh files that invoke Ant.
>
>To the rest of you all...READ MY ENTIRE EMAIL!

well ... what do you need in you shell scripts that is not provided by ant ?

Cheers,

Pete

*------------------------------------------------------*
| Despite your efforts to be a romantic hero, you will |
| gradually evolve into a postmodern plot device.      |
*------------------------------------------------------*


Re: beanshell

Posted by James Duncan Davidson <du...@x180.com>.
On 11/14/00 12:50 PM, "Jon Stevens" <jo...@latchkey.com> wrote:

> You seem to be the ONLY person who actually read my entire email. I was
> referring to the .bat/.sh files that invoke Ant.
> 
> To the rest of you all...READ MY ENTIRE EMAIL!
> 
> :-(

Oh I did.. :) And I figured out that you were talking about the .bat/.sh
invokation files. My comment is that you should add support to the current
set of invokation methods -- not replace those. As clunky as they are, shell
support (and even bass-silly Windows command prompt support) is important
imho.

-- 
James Duncan Davidson                                        duncan@x180.com
                                                                  !try; do()


Re: beanshell

Posted by Jon Stevens <jo...@latchkey.com>.
on 11/11/2000 7:40 PM, "Conor MacNeill" <co...@m64.com> wrote:

> Jon,
> 
> beanshell looks cool. Are you referring to the ant .bat/.sh files
> themselves or to .bat/.sh files that are invoked from an ant build?
> 
> Conor

Hi Conor,

You seem to be the ONLY person who actually read my entire email. I was
referring to the .bat/.sh files that invoke Ant.

To the rest of you all...READ MY ENTIRE EMAIL!

:-(

-jon

> hey all,
> 
> i'm new to the list, but i have actually got some of my code in Ant so i'm
> not new to Ant by any means.
> 
> Since i'm new to the list, i'm not sure what sort of discussion has already
> happened around adding BeanShell support to Ant. Can anyone catch me up real
> quick?
> 
> <http://www.beanshell.org/>
> 
> If no discussion has happened, I would like to propose that we add BeanShell
> support to Ant. What I would like to do is essentially use BeanShell as a
> replacement for the complex .sh/.bat files that we have to use to go along
> with execution of Ant.
> 
> Ant and BeanShell essentially overlap in functionality quite a bit, so, I'm
> not really proposing even making a BeanShell Task, although I think that
> might be a good idea in the future for people who might want to execute
> their stuff as BeanShell Script vs. Ant .xml syntax.
> 
> The real problem that I'm having now is that the .sh and .bat files are a
> real pain in the ass to manage and are not easily re-usable and I would like
> to move the code that is in those files off to something that is a bit more
> cross platform portable, like BeanShell.
> 
> Essentially, we could replace 99% of what is in the .sh and .bat files with
> something like this:
> 
> <http://www.beanshell.org/manual/execscripts.html>
> 
> Where the contents of the .sh and .bat files would then be "ported" over to
> BeanShellScript language.
> 
> I'm also willing to spend some 2am coding time on working on this as this is
> a real problem for me...
> 
> Comments? Flames? Suggestions?
> 
> -jon


RE: beanshell

Posted by Conor MacNeill <co...@m64.com>.
Jon,

beanshell looks cool. Are you referring to the ant .bat/.sh files
themselves or to .bat/.sh files that are invoked from an ant build?

Conor


> -----Original Message-----
> From: Jon Stevens [mailto:jon@latchkey.com]
> Sent: Sunday, 12 November 2000 7:16
> To: ant-dev@jakarta.apache.org
> Subject: beanshell
>
>
> hey all,
>
> i'm new to the list, but i have actually got some of my code
> in Ant so i'm
> not new to Ant by any means.
>
> Since i'm new to the list, i'm not sure what sort of
> discussion has already
> happened around adding BeanShell support to Ant. Can anyone
> catch me up real
> quick?
>
> <http://www.beanshell.org/>
>
> If no discussion has happened, I would like to propose that
> we add BeanShell
> support to Ant. What I would like to do is essentially use
> BeanShell as a
> replacement for the complex .sh/.bat files that we have to
> use to go along
> with execution of Ant.
>
> Ant and BeanShell essentially overlap in functionality quite
> a bit, so, I'm
> not really proposing even making a BeanShell Task, although I
> think that
> might be a good idea in the future for people who might want
> to execute
> their stuff as BeanShell Script vs. Ant .xml syntax.
>
> The real problem that I'm having now is that the .sh and .bat
> files are a
> real pain in the ass to manage and are not easily re-usable
> and I would like
> to move the code that is in those files off to something that
> is a bit more
> cross platform portable, like BeanShell.
>
> Essentially, we could replace 99% of what is in the .sh and
> .bat files with
> something like this:
>
> <http://www.beanshell.org/manual/execscripts.html>
>
> Where the contents of the .sh and .bat files would then be
> "ported" over to
> BeanShellScript language.
>
> I'm also willing to spend some 2am coding time on working on
> this as this is
> a real problem for me...
>
> Comments? Flames? Suggestions?
>
> -jon
>
> --
> http://scarab.tigris.org/    | http://noodle.tigris.org/
> http://java.apache.org/      | http://java.apache.org/turbine/
> http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
> http://www.collab.net/       | http://www.sourcexchange.com/
>


Re: beanshell

Posted by Peter Donald <do...@apache.org>.
At 09:23  13/11/00 +0100, you wrote:
>Peter Donald <do...@apache.org> wrote:
>
>> First and most importantly is dynamically loading taskdefinitions
>> from a specific jar file after compiling it.
>
>Pete, I think this should be possible since Ant 1.2alpha3. What is the
>problem? Am I missing something?

essentially when the task depends on other classes compiled during build
process or on other jars indicated via manifest entries etc.

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: beanshell

Posted by Stefan Bodewig <bo...@bost.de>.
Peter Donald <do...@apache.org> wrote:

> First and most importantly is dynamically loading taskdefinitions
> from a specific jar file after compiling it.

Pete, I think this should be possible since Ant 1.2alpha3. What is the
problem? Am I missing something?

Stefan

Re: beanshell

Posted by Peter Donald <do...@apache.org>.
At 04:33  13/11/00 -0800, you wrote:
>On 11/11/00 7:14 PM, "Peter Donald" <do...@apache.org> wrote:
>
>> There are currently 2 things lacking that are not currently possible from
>> ant (yet). First and most importantly is dynamically loading
>> taskdefinitions from a specific jar file after compiling it. While this was
>> done for simple case (where you just need to compile one class) it does not
>> work for complex taskdefs which have multiple interwoven dependencies.
>> Someone has provided a patch to get this to work but it hasn't been added
>> into CVS yet and I think there was a few issues that needed to be worked
>> out first.
>
>
>Yep. That's needed as a core feature. It's something that I've already put
>some investigating into for part of a proposed Ant 2.

Did not Nico provide an implementation already as a patch ? Was there
anything wrong with it ?

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Re: beanshell

Posted by Jon Stevens <jo...@latchkey.com>.
on 11/12/2000 2:34 PM, "Christopher Elkins" <ce...@scardini.com> wrote:

> I've actually done this already. The Turbine build scripts now do nothing more
> than build the minimal classpath required for Ant and launch it. Indeed, you
> can
> now build Turbine by calling:
> $ANT_HOME/bin/ant -buildfile build-turbine.xml [target]
> 
> where the current directory is turbine/build and ANT_HOME points to Ant 1.2 or
> higher.

Ok, this is what I was looking for. :-) Thanks Christopher.

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/



Re: beanshell

Posted by Christopher Elkins <ce...@scardini.com>.
<snip>
> Just curious but is this for turbine .sh/.bat files. If so I would be happy
> to show you how to change them so that they are simple one liners. At one
> stage I had all the turbine scripts with but a few lines and could probably
> do that again if you want.
<snip>
>
I've actually done this already. The Turbine build scripts now do nothing more
than build the minimal classpath required for Ant and launch it. Indeed, you can
now build Turbine by calling:
   $ANT_HOME/bin/ant -buildfile build-turbine.xml [target]

where the current directory is turbine/build and ANT_HOME points to Ant 1.2 or
higher.

> Cheers,
>
> Pete
>

...sorry for the temporary Turbine noise. ;-)

--
Christopher Elkins


Re: beanshell

Posted by James Duncan Davidson <du...@x180.com>.
On 11/11/00 7:14 PM, "Peter Donald" <do...@apache.org> wrote:

> There are currently 2 things lacking that are not currently possible from
> ant (yet). First and most importantly is dynamically loading
> taskdefinitions from a specific jar file after compiling it. While this was
> done for simple case (where you just need to compile one class) it does not
> work for complex taskdefs which have multiple interwoven dependencies.
> Someone has provided a patch to get this to work but it hasn't been added
> into CVS yet and I think there was a few issues that needed to be worked
> out first.


Yep. That's needed as a core feature. It's something that I've already put
some investigating into for part of a proposed Ant 2.

.duncan


Re: beanshell

Posted by Peter Donald <do...@apache.org>.
At 12:15  11/11/00 -0800, you wrote:
>Since i'm new to the list, i'm not sure what sort of discussion has already
>happened around adding BeanShell support to Ant. Can anyone catch me up real
>quick?
>
><http://www.beanshell.org/>

The best thing IMO would be to use Bean Scripting Framework from IBM. It is
really groovy and covers is an interface to a lot of scripting languages
(unfortunately beanshell is not one of them). You can already use BSF to do
practically anything you can do in java.

>If no discussion has happened, I would like to propose that we add BeanShell
>support to Ant. What I would like to do is essentially use BeanShell as a
>replacement for the complex .sh/.bat files that we have to use to go along
>with execution of Ant.

Just curious but is this for turbine .sh/.bat files. If so I would be happy
to show you how to change them so that they are simple one liners. At one
stage I had all the turbine scripts with but a few lines and could probably
do that again if you want. 

There are currently 2 things lacking that are not currently possible from
ant (yet). First and most importantly is dynamically loading
taskdefinitions from a specific jar file after compiling it. While this was
done for simple case (where you just need to compile one class) it does not
work for complex taskdefs which have multiple interwoven dependencies.
Someone has provided a patch to get this to work but it hasn't been added
into CVS yet and I think there was a few issues that needed to be worked
out first.

The other problem is grabbing environment variables which is simply
impossible from java (at least in a cross platform manner). Some one I
believe sent a patch (or at least suggested) that you run a script that
would automagically import all shell variables as java system properties.
So if you had a shell variable CLASSPATH it would be avaialable as
"env.CLASSPATH". I know how to do this on *nix but not sure if it is
possible under win9x so ....

If there is any other demands you need feel free to suggest em ;)

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*