Great idea! I haven't tried this (the code below) yet, but it seems like a
good approach -- it's Emacs, so let the user customize how to invoke Ant!
Steve
-----Original Message-----
From: Douglas WF Acheson [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 23, 2001 11:15 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: jde-ant
Hello,
I have completed, the first stage, of the modifications to jde-ant.el
which allows a user to select the invocation style, either script or
via Java. I have added appropriate comments to the jde-ant.el file to
indicate the changes. I will repeat here:
added 3 custom variables
jde-ant-class
indicates which java class to invoke
default value is org.apache.tools.ant.Main
jde-ant-classpath
List of jar files needed to run ant.
This needs to be set to include the 3 ant jar files
and the tools.jar from Sun.
I have chosen to use this instead of using the global
classpath as the jar files used to invoke ant is not
necessarily needed to compile the classes. I think, IMHO,
this makes it cleaner.
jde-ant-invocation-style
Used to determine how to invoke jde-ant, the default how
Jason would like to see it.
Added 1 defun
jde-ant-build-classpath
This defun creates the classpath from the list of jars in
jde-ant-classpath.
To Do:
Add one more customer var to indicate the home directory of Ant.
Thereby, automatically creating the required classpath to include
the 3 ant jar files and the tools.jar from Sun. This allows the
user to include the additional jar files they need to run ant
and not worry about the required jars.
If I have made a error please let me know.
Douglas WF Acheson
P.S. If you can come up with better wording for the
jde-ant-invocation-style I would be very much appreciated.
--- [EMAIL PROTECTED] wrote:
>
> Douglas
>
> What if, instead of using the custom string variable jde-ant-program,
> a new
> custom variable jde-ant-invocation-style is a choice between invoking
> a
> specific script or invoking a function that generates the appropriate
> Ant
> command. Perhaps something like:
>
> Jde Ant Invocation Style: [Hide]
>
> (*) Use program or script
> Script/Program : __________________________________________
>
> ( ) Invoke function
> Function : ________________________________________________
>
>
> This way, jde-ant is flexible enough to do the things you want. When
> jde-ant-build is called, the invocation style variable will be
> checked, and
> the ant command will be built accordingly...
> A standard function could be created to invoke the jvm defined by
> 'jde-run-java-vm' using the classpath defined by
> 'jde-global-classpath'/'jde-run-option-classpath' and the Ant main
> class.
>
> Thoughts?
>
> Jason
>
>
>
>
>
>
>
> Douglas WF
>
> Acheson To:
> [EMAIL PROTECTED]
>
> <[EMAIL PROTECTED] cc:
>
> om> Subject: Re: jde-ant
>
>
>
> 07/19/01
>
> 02:00 PM
>
>
>
>
>
>
>
>
>
> Hello,
>
> I understand your position about running ant. Would it be possible
> to allow changes so that you can use it either way? They way you
> have
> outlined below, via the ant batch/shell script, and invoking a JVM to
> run ant.
>
> Allowing jde-ant to be invoked via a JVM directly allows more
> flexible within Emacs. Using this model allows changes to be
> controlled within Emacs and not in the batch/shell script.
> Therefore,
> change need to occur within the environment of the project and not to
> the batch/shell script.
>
> I have made the necessary changes to jde-ant.el to invoke the JVM.
> It was not hard, and very little changes required.
>
> I was thinking have a boolean switch (jde-ant-use-jvm) that is
> checked to see how to invoke ant. This allows users to invoke it the
> way you intended or to allow customization totally in Emacs.
>
> I believe this is a natural evolution in jde-ant. I have no
> hesitation to provide my services to make the changes and help
> maintain
> those changes.
>
> What do you think? Is it viable?
>
>
> Douglas WF Acheson
>
> --- [EMAIL PROTECTED] wrote:
> >
> > Douglas
> >
> > Invoking the jvm from jde-ant is something that has been discussed
> > and
> > considered. However, my main objection is that Ant is a
> > cross-platform
> > project build tool that has no (and should have no) dependencies on
> > Emacs
> > or JDE. Developers need to be able to provide clear build
> > instructions to
> > the CM/build teams. Simpler instructions are better. Typically
> (or,
> > at
> > least, in my experience) a shell script is used to hide some of the
> > complexity of passing arguments to java/Ant. Most teams probably
> > just use
> > the default shell scripts that are provided with Ant (I do :).
> >
> > I don't want to seem stubborn/bull-headed/pedantic, but my
> > inclination is
> > to keep jde-ant simple, but convenient, as far as invoking Ant
> > builds.
> > Once you have jde-ant invoking Ant through the vm, you introduce
> all
> > kinds
> > of additional complexity--what VM to use?, should one use Beanshell
> > to do
> > the invocation?, where are the required .jar files (ant.jar,
> > xerces.jar...)? etc.--that I think is desirable to avoid.
> >
> > In your case, I think the best options are:
> > 1) put your custom tasks in a jar and add it to the ANT_HOME/lib
> > directory, or
> > 2) set your CLASSPATH environment variable to include the
> > appropriate
> > items
> > 3) edit the ant(.bat) shell script to include your classpath
> > config,
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Douglas WF
> >
> > Acheson To:
> > [EMAIL PROTECTED]
> >
> > <[EMAIL PROTECTED] cc: [EMAIL PROTECTED]
> >
> > om> Subject: Re: jde-ant
> >
> >
> >
> > 07/18/01
> >
> > 02:23 PM
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Jason,
> >
> > I think I finally understand :-) The jde-ant calls the ant.bat
> > script. Why not just have the jde-build-ant-command invoke the jvm
> > using the Ant.class. This way the call to ant is total
> customizable,
> > I
> > believe. In addition, all you have to to is change custom
> variables
> > and do not worry about the bat/sh file.
> >
> > Douglas WF Acheson
> >
> > --- Douglas WF Acheson <[EMAIL PROTECTED]> wrote:
> > > Thanks for the reply Jason,
> > >
> > > I do not mean to be a pain in the ass.
> > >
> > > Option #1, IMO, will not work as the custom variable jde-ant-args
> > is
> > > used to pass args to ant. I need to modify the classpath for the
> > JVM
> > > that runs ant.
> > >
> > > Option #2, totally agree, too much work.
> > >
> > > Option #3, IMO, is the chicken and egg problem. Need to find the
> > > class
> > > before using the class.
> > >
> > > Currently I get a class not found error when running ant as the
> JVM
> > > class loader cannot find my classes.
> > >
> > > I need to do the following:
>
=== message truncated ===
=====
Douglas WF Acheson
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/