Initial revision

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@362 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
David Dixon-Peugh
2002-07-15 21:28:10 +00:00
parent 08f2b0d19d
commit 974c6c9f21
3 changed files with 64 additions and 0 deletions

14
pmd-emacs/CHANGELOG Normal file
View 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
View 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
View 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)