Paul,

Here is the modifications to jde-ant.el.  I do not know how to add them
to CVS, do not know that I want that power :-).  The changes are easy
just add the code found below to jde-ant.el and make this change in
jde-ant.el:

replace
  (setq ant-command
    (concat jde-ant-program " -Dbuffer=" buffer-file-name " "))
with
    (if (string= (car jde-ant-invocation-style) "Script")
    ; then
      (setq ant-command
        (concat jde-ant-program " -Dbuffer=" buffer-file-name " "))
    ; else
      (setq ant-command
        (concat "java " (jde-ant-build-classpath) " "
                 jde-ant-class " -Dbuffer=" buffer-file-name " "))
    )

  To use jde-ant via Java invocation the user must specify where the
ant jar files are located through the jde-ant-dir variable. And where
the jdk is located via the jde-ant-jdk-dir variable.  These are the
only
two defcustom variables that need to be set.  Once that is done the
user is off to the races.


  I have tested it out only with XEmacs and Win2k.  I am fairly sure it
will work regardless, says here in fine print :-)

dwfa

;;; start of Douglas WF Acheson mod
;;; The next three custom variables and defun added by Douglas WF
Acheson to
;;; allow a user to select how ant is invoked, either by script or via
Java

(defcustom jde-ant-invocation-style (list "Script")
  "*Specifies how to invoke ant.  Ant can be invoked in one of two
ways.
     The first is via the ant script/program that comes with ant.
     The second if via java; here you specify which class to start.
       usually org.apache.tools.ant.Main.  Using this method you must
specify
       the four required jar files (ant.jar, jaxp.jar, parser.jar,
tools.jar
       from Sun) in the jde-ant-classpath.
     Script -- invokes ant using the jde-ant-build-function
     Java   -- invokes ant via the class defined in jde-ant-class"
  :group 'jde-project
  :type '(list
           (radio-button-choice
             (const "Script")
             (const "Java")
           )
         )
)

(defcustom jde-ant-jdk-dir nil
  "*Root directory containing the jdk to invoke ant"
  :group 'jde-project
  :type  'string
)

(defcustom jde-ant-jdk-jars (list "tools.jar")
  "*Contains the list of jdk jar files required by ant."
  :group 'jde-project
  :type '(repeat (file :tag "Jar"))
)

(defcustom jde-ant-class "org.apache.tools.ant.Main"
  "*Specifies class to invoke for Ant."
 :group 'jde-project
 :type 'string
)

(defcustom jde-ant-dir nil
  "*Directory where ant jar files are locationed."
  :group 'jde-project
  :type  'string
)

(defcustom jde-ant-jars (list "ant.jar" "crimson.jar" "jaxp.jar"
"optional.jar")
  "*Contains the list of ant jars files."
  :group 'jde-project
  :type '(repeat (file :tag "Jar"))
)

(defcustom jde-ant-additional-jarfiles nil
  "*Specifies the list of additional jar files.  These list usually
contains
   jar files that hold user defined tasks."
  :group 'jde-project
  :type '(repeat (file :tag "Path"))
)

(defun jde-ant-build-jarfiles (antPath antJarFiles jdkPath jdkJarFiles)
  "Construct the list of jar files needed by ant."
  (if (and (boundp 'jde-ant-dir)     (boundp 'jde-ant-jars)
           (boundp 'jde-ant-jdk-dir) (boundp 'jde-ant-jdk-jars))
  ; then
    (progn
      (setq jde-ant-cp nil)
      (while antJarFiles
        (setq jde-ant-cp (append jde-ant-cp (list (concat antPath "\"
(pop antJarFiles)))))
      )
      (while jdkJarFiles
        (setq jde-ant-cp (append jde-ant-cp (list (concat jdkPath
"\lib\" (pop jdkJarFiles)))))
      )
      jde-ant-cp
    )
  ; else
    nil
  )
)

(defun jde-ant-build-classpath ()
  "Constructs the classpath used to invoke ant."
  (if (and (boundp 'jde-ant-dir)     (boundp 'jde-ant-jars)
           (boundp 'jde-ant-jdk-dir) (boundp 'jde-ant-jdk-jars))
    ; then
    (concat "-classpath "" (jde-build-classpath 
                             (append (jde-ant-build-jarfiles
                                        jde-ant-dir
                                        jde-ant-jars
                                        jde-ant-jdk-dir
                                        jde-ant-jdk-jars
                                      )
                                      (if (boundp
'jde-ant-additional-jarfiles)
                                        jde-ant-additional-jarfiles
                                      )
                              )
                            ) """
    )
    ; else
    ""
  ) ; end if
)

;;; end of Douglas WF Acheson mod



=====
Douglas WF Acheson

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Reply via email to