Thanks for this. I had been tweaking the additions you sent before
to do this build file parsing as well.
Now I'm working on trying to make the buildfile location functionality
a bit more consistent/explicit. I figure there are the following possibilities:
1) The user wants to explicitly specify the exact buildfile to use for the project (i.e., it will be saved in prj.el, as jde-ant-buildfile)Am I missing anything? I think the default behavior will probably be to find the buildfile, using jde-ant-buildfile-name, with default value "build.xml".
2) The user wants to be prompted for an explicit buildfile to use.
3) The user wants the buildfile specified by a project variable (e.g., jde-ant-find-buildfile-name) to be found by searching up the directory hierarchy.
4) The user wants to be prompted for a buildfile name, which will be sought recursively up the directory hierarchy.
I am also planning on no longer using the -find switch for Ant. It seems too inconsistent/confusing to use Emacs to find the buildfile in some cases and Ant to find it in others.
V/R
Jason
"Molitor, Stephen" wrote:
Jason,Here's a new version of jde-ant.el, that gets the list of completion targets by parsing the build file directly. Since this seems fairly fast, I changed jde-ant-complete-targets to default to true. I added a new function, jde-ant-find-buildfile. I copied this from jde-find-project-file. (Perhaps a new function could be written, jde-find-file-upwards, that would take two arguments, a file name and a directory, and search upwards in the directory hierarchy for the file. Jde-find-project-file and jde-ant-find-buildfile would both be changed to use this function. This would avoid duplicate code.) I changed jde-ant-get-project-alist to use jde-ant-find-buildfile and parse it directly. It just does normal text parsing, searching for '<target name="*"'. In a way it would be cleaner to use an XML parser, but that would introduce a new dependency. The jde-ant-interactive-target-arg-history defvar declaration is also still in there; if you've already added it you'll want to make sure to remove my declaration of it so it's not there twice.You've convinced me, at least, that this is the way to go. It's faster, and simpler than I thought. It does bypass the shell, and duplicates 'ant -find' functionality, but it's only for reading the targets for auto-completion. Steve
begin:vcard n:Stell;Jason tel;pager:800-724-3329 PIN 382-8028 tel;work:(703) 471-2529 x-mozilla-html:FALSE url:http://www.intelixinc.com adr:;;;;;; version:2.1 email;internet:[EMAIL PROTECTED] title:Consultant (Intelix, Inc.) fn:Jason Stell end:vcard
