Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. (defvar ant-command-history nil
  2. "Ant command history variable")
  3.  
  4. (defun ant(&optional args)
  5. "Runs ant in the current project. Starting at the directory
  6. where the file being visited resides, a search is made for
  7. build.xml recursively. A maven command is made from the first
  8. directory where the build.xml file is found is then displayed in
  9. the minibuffer. The command can be edited as needed and then
  10. executed. Errors are navigate to as in any other compile mode"
  11. (interactive)
  12. (let ((fn (buffer-file-name)))
  13. (let ((dir (file-name-directory fn)))
  14. (while (and (not (file-exists-p (concat dir "/build.xml")))
  15. (not (equal dir (file-truename (concat dir "/..")))))
  16. (setf dir (file-truename (concat dir "/.."))))
  17. (if (not (file-exists-p (concat dir "/build.xml")))
  18. (message "No build.xml found")
  19. (compile (read-from-minibuffer "Command: "
  20. (concat "ant -emacs -f "
  21. dir "/build.xml compile") nil
  22. nil
  23. 'ant-command-history))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement