From 1b0abee054235ea4ac7589dd92d3939e1386d24a Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 12 Oct 2010 23:39:29 +0200 Subject: Initial contents --- prog/jao-java-ant.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 prog/jao-java-ant.el (limited to 'prog/jao-java-ant.el') diff --git a/prog/jao-java-ant.el b/prog/jao-java-ant.el new file mode 100644 index 0000000..27c6420 --- /dev/null +++ b/prog/jao-java-ant.el @@ -0,0 +1,20 @@ +(require 'jao-dominating-file) + +(eval-after-load 'cc-mode + '(progn + (add-hook 'java-mode-hook + (lambda () + (set (make-local-variable 'compile-command) "ant"))) + (define-key java-mode-map "\C-cc" 'jao-java-ant-build))) + +(defun jao-java-ant-build () + (interactive) + (let ((build-file (jao-locate-dominating-file "build\\.xml"))) + (unless build-file + (error "Couldn't find associated build file")) + (let ((default-directory (file-name-directory build-file))) + (call-interactively 'compile)))) + +(provide 'jao-java-ant) + +;; End of jao-java-ant.el -- cgit v1.2.3