Initial revision
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@362 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
14
pmd-emacs/CHANGELOG
Normal file
14
pmd-emacs/CHANGELOG
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
Version 0.1 -
|
||||
|
||||
First version of PMD for Emacs
|
||||
|
||||
Defined one function "pmd-current-buffer" which will
|
||||
run PMD on the current buffer, and write the output
|
||||
to *PMD*
|
||||
|
||||
Output format is in XML. I will work in trying to
|
||||
get a better, easier to read format for everyone.
|
||||
|
||||
Share and Enjoy!
|
||||
|
20
pmd-emacs/INSTALL
Normal file
20
pmd-emacs/INSTALL
Normal file
@ -0,0 +1,20 @@
|
||||
Installing PMD For Emacs:
|
||||
|
||||
1) Download PMD-0.4 from SourceForge, and unpack into a directory.
|
||||
|
||||
2) Copy src/elisp/pmd.el to a directory on your Elisp Path
|
||||
|
||||
3) Inside your ".emacs" file, (require 'pmd)
|
||||
|
||||
4) Set the following variables in ".emacs"
|
||||
pmd-java - Java binary to run PMD with.
|
||||
pmd-home - Directory where PMD was installed.
|
||||
pmd-rulesets - Ruleset to use (must be in the PMD jar.)
|
||||
|
||||
There is a customize group under PMD, which you can also
|
||||
use to customize PMD installation.
|
||||
|
||||
Also, I'm sure there are others out there who know more about
|
||||
customizing Emacs than I do. Feel free to chip in here and
|
||||
there.
|
||||
|
30
pmd-emacs/src/elisp/pmd.el
Executable file
30
pmd-emacs/src/elisp/pmd.el
Executable file
@ -0,0 +1,30 @@
|
||||
|
||||
(defgroup pmd nil "PMD"
|
||||
:group 'emacs)
|
||||
|
||||
(defcustom pmd-java-home "/usr/local/bin/java"
|
||||
"Java binary to run PMD with."
|
||||
:type 'file
|
||||
:group 'pmd )
|
||||
|
||||
(defcustom pmd-home "~/pmd"
|
||||
"Directory where PMD is installed."
|
||||
:type 'directory
|
||||
:group 'pmd)
|
||||
|
||||
(defcustom pmd-rulesets "rulesets/basic.xml"
|
||||
"Rulesets to apply"
|
||||
:type 'string
|
||||
:group 'pmd)
|
||||
|
||||
(defun pmd-current-buffer ()
|
||||
"Run PMD on the contents of the current buffer."
|
||||
(interactive)
|
||||
(let ((file-name (buffer-file-name) )
|
||||
(pmd-buffer-create (get-buffer "*PMD*"))
|
||||
(pmd-jar (concat pmd-home "/lib/pmd-0.4.jar")))
|
||||
(shell-command (concat pmd-java-home " -cp " pmd-jar
|
||||
" net.sourceforge.pmd.PMD "
|
||||
file-name " xml " pmd-rulesets ))))
|
||||
|
||||
(provide 'pmd)
|
Reference in New Issue
Block a user