Created
September 14, 2012 18:30
-
-
Save irq0/3723779 to your computer and use it in GitHub Desktop.
emacs: java flymake, runtime syntax check with cedet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Dependencies: ecj (in MacPorts), ede project for the file, cedet development version (from bzr) | |
(require 'flymake) | |
(defvar flymake-java-version "1.6") | |
(defun flymake-java-ecj-init () | |
(flymake-simple-make-init-impl | |
'flymake-create-temp-with-folder-structure nil nil | |
(file-name-nondirectory buffer-file-name) | |
'flymake-java-ecj-cmdline)) | |
(defun flymake-java-ecj-cmdline (source base-dir) | |
(let* ((project (ede-current-project)) | |
(classpath (append (ede-java-classpath project) | |
semanticdb-javap-classpath | |
(list (concat-path (oref project :directory) (first (oref project :srcroot))))))) | |
(list "ecj" (list "-Xemacs" "-d" "none" | |
"-source" flymake-java-version | |
"-target" flymake-java-version | |
"-classpath" | |
(combine-and-quote-strings classpath ":") | |
source)))) | |
(push '(".+\\.java$" flymake-java-ecj-init) flymake-allowed-file-name-masks) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment