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:
>
> java -classpath
> antPath/ant.jar;antPath/jaxp.jar;antPath/parser.jar;myPath/my.jar ant
> -emacs ..
>
> What I want to do is modify the classpath that is used by the JVM to
> run ant.  I have looked at the code in jde-ant.el, but do not see
> where
> the classpath is constructed.  SO, I was wondering if you could add
> or
> help me add the ability to have a customer variable where users can
> add
> there own things to the classpath that is used to by the JVM when
> running ant.
>
> If this not clear please let me know.
>
> Douglas WF Acheson
>
> --- [EMAIL PROTECTED] wrote:
> >
> > Douglas
> >
> > Options:
> >
> > 1 - You can use the jde-ant-args custom variable to pass in the
> > classpath
> > you want to use.
> >
> > 2 - There is a custom variable jde-ant-program that points to the
> > script
> > that runs Ant. You could also edit the script (or create a new one)
> > that
> > passes in the classpath you want to use; however, this isn't
> > particularly
> > elegant (or portable), and I generally discourage doing anything
> > fancy in
> > the script you use to run Ant.
> >
> > 3 - Modify your custom Ant tasks to allow specification of the
> > classpath
> > (for an example, look at how the javac task is implemented).
> >
> > HTH
> >
> > Jason
> >
> >
> >
> >
>
> >
> >                     Douglas WF
>
> >
> >                     Acheson              To:
> > [EMAIL PROTECTED]
>
> >
> >                     <[EMAIL PROTECTED]        cc:     [EMAIL PROTECTED]
>
> >
> >                     om>                  Subject:     Re: jde-ant
>
> >
> >
>
> >
> >                     07/18/01
>
> >
> >                     11:30 AM
>
> >
> >
>
> >
> >
>
> >
> >
> >
> >
> >
> > Hello,
> >
> >   Thanks for the reply.  I was under the impression that the custom
> > tasks, the ones that I have developed need to be part of the
> > classpath
> > that ant uses.  So, if I were to start ant from the command line
> (not
> > under Emacs) I would include the ant.jar, parser.jar, and jaxp.jar
> > plus
> > my.jar in the -classpath option to java.  I believe that the
> example
> > below will not work correctly.
> >
> > Am I missing something?
> >
> > Thanks ...
> >
> > Douglas WF Acheson
> >
> > --- [EMAIL PROTECTED] wrote:
> > >
> > > Douglas
> > >
> > > Regarding your second issue, I typically do something like the
> > > following in
> > > my ant build.xml file
> > >
> > >        <!-- Path element containing all jar files in lib
> directory>
> > -->
> > >        <path id="lib.class.path">
> > >          <fileset dir="${lib.dir}">
> > >            <include name="**/*.jar"/>
> > >          </fileset>
> > >        </path>
> > >
> > > Then, in my javac task, I have something like the following
> > >
> > >      <classpath>
> > >        <pathelement location="${build.dest.dir}"/>
> > >        <path refid="lib.class.path"/>
> > >      </classpath>
> > >
> > > BTW: I am in the process of making some (relatively extensive)
> > > changes to
> > > jde-ant (jmode-ant). One of the new features will be the ability
> to
> > > create
> > > a new build definition file from a template.
> > >
> > >
> > > Regards
> > > Jason
> > >
> > >
> > >
> > >
> > >
> > >                     Douglas WF
> > >
> > >                     Acheson              To:
> [EMAIL PROTECTED]
> > >
> > >                     <[EMAIL PROTECTED]        cc:
> > >
> > >                     om>                  Subject:     jde-ant
> > >
> > >
> > >
> > >                     07/18/01
> > >
> > >                     09:29 AM
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Hello,
> > >
> > >    After finally moving to ant to build my java apps I would like
> > to
> > > use the jde-ant feature (new name jmode-ant :-)  I have played
> with
> > > it
> > > for the last few days.  I found a potential problem using XEmacs.
>
> > I
> > > had to add the following code
> > > from
> > >   (let ((temp last-nonmen-event))
> > > to
> > >   (let ((temp (if (boundp 'last-nonmenu-event)
> > >                   last-nonmen-event
> > >                      nil)))
> > > to avoid getting a
>
=== message truncated ===


=====
Douglas WF Acheson

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/




Reply via email to