Using jde-ant build with default shell
"Jere McDevitt" <[email protected]> Sun, 15 Apr 2007 20:15:59 -0500
| Newsgroups | gmane.emacs.jdee |
|---|---|
| Message-ID | <20070416001517.GPSK3772.ispmxaamta05-gx.windstream.net@greymouse> |
Normally I use ntemacs and jdee with the Cygwin tools installed, but due to
some restrictions in a particular situation, I can use ntemacs & jdee but
not cygwin. When doing an ant build (C-c C-v C-b), the build would fail
with:
cd k:/devel/projects/client/src/client/
ant -buildfile 'k:/devel/projects/client/build.xml' -emacs test
Buildfile: 'k:\devel\projects\client\build.xml' does not exist!
Build failed
even though that is the correct build file. It turns out the default shell
for emacs (emacs/bin/cmdproxy.exe which is the Windows cmd.exe shell) does
not like the single quote marks that are surrounding the build file name.
To work around this, I made the following modifications to jde-ant.el
($Revision: 1.76.2.1 $ $Date: 2006/03/05 04:40:14 $) of the latest build
(2.3.5.1):
249,255c249,257
< (delimiter (if (or
< (string= (car jde-ant-invocation-method) "Java")
< (and (string= (car jde-ant-invocation-method)
< "Script")
< (not (featurep 'xemacs))))
< "'"
< "\""))
---
> (delimiter (if (string-match "cmdproxy.exe" shell-file-name)
> "\""
> (if (or
> (string= (car jde-ant-invocation-method) "Java")
> (and (string= (car jde-ant-invocation-method)
> "Script")
> (not (featurep 'xemacs))))
> "'"
> "\"")))
This changes the single quotes (') to double quotes (") if the shell is
cmdproxy, regardless of the invocation method. It may fail when using the
ant server, but I don't use that so I'm not sure.
I'm an elisp novice, but this seems to work both when I have a cygwin bash
shell in use or the default Window's shell. If there is a better way to
make this work I'd appreciate seeing it so I don't have to have a modified
version of the lisp files.
Thanks
Jere