Added Jeff's Textpad notes

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2291 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-10-06 19:25:23 +00:00
parent 9d925253f6
commit ddbea7223c

View File

@ -125,9 +125,78 @@ you can change the plugin to prompt you for a directory to check by going to tha
selecting the "Ask for Directory" checkbox.</p>
</subsection>
<subsection name="Maven">
<p>Please see <a href="http://maven.apache.org/reference/plugins/pmd/index.html">the Maven plugins web site</a> for more information.</p>
</subsection>
<subsection name="Maven">
<p>Please see <a href="http://maven.apache.org/reference/plugins/pmd/index.html">the Maven plugins web site</a> for more information.</p>
</subsection>
<subsection name="TextPad">
<H5><U>Assumptions</U></H5>
<P><UL>
<LI>The Java Development Kit, version 1.3.1 (versions 1.3 and higher are acceptable) is properly installed into your machine, and exists in <CODE>D:\java\jdk_131\</CODE>. This means that <CODE>D:\java\jdk_131\bin\java.exe</CODE> exists.</LI>
<LI>PMD version 1.2.1 exists in <CODE>D:\java\pmd-1.2.1\</CODE>. This means that <CODE>D:\java\pmd-1.2.1\lib\pmd-1.2.1.jar</CODE> (among other jar files in the same directory) exist.</LI>
</UL></P>
<H5><U>To integrate into TextPad</U></H5>
<P><OL>
<LI>In the <B>Configure</B> menu, choose <B>Preferences...</B>. This opens the Preferences dialog</LI>
<LI>In the left pane of the Preferences dialog, choose the <B>Tools</B> branch by clicking on the <I>word</I> "Tools".</LI>
<LI>On the far right of the dialog, click on the <B>Add</B> button, and then select <B>Program...</B> from the drop-down. This opens the standard Windows Open File dialog.</LI>
<LI>Type <CODE>D:\java\jdk_131\bin\java.exe</CODE> and click the <B>Open</B> button. In the center pane of the Preferences dialog, an item "Java" has now been added, and is currently selected.</LI>
<LI>Click the word Java, which makes the word editable. Select the entire word, and type "PMD directory". Press Return</LI>
<LI>Repeat steps three through five, but type "PMD file", instead of "PMD directory".</LI>
<LI>Click <B>Apply</B>.</LI>
<LI>Expand the <B>Tools</B> branch (if not already) by clicking on the '<CODE>+</CODE>' directly to its left.</LI>
<LI>In the expanded list, select <B>PMD directory</B>. This changes the right side of this dialog to the "tool" form.</LI>
<LI>In the "tool" form, enter these parameters:<UL>
<LI><B>Parameters:</B> <CODE>-classpath D:\java\pmd-1.2.1\lib\pmd-1.2.1.jar;D:\java\pmd-1.2.1\lib\jaxen-core-1.0-fcs.jar; D:\java\pmd-1.2.1\lib\saxpath-1.0-fcs.jar;D:\java\pmd-1.2.1\lib\xmlParserAPIs-2.0.2.jar; D:\java\pmd-1.2.1\lib\xercesImpl-2.0.2.jar net.sourceforge.pmd.PMD <I><B>$FileDir</B></I> net.sourceforge.pmd.renderers.TextPadRenderer E:\directory\my_pmd_ruleset.xml -debug</CODE>
<BR/>(<I>Eliminate the spaces following both '<CODE>jaxen-core-1.0-fcs.jar;</CODE>' and '<CODE>xmlParserAPIs-2.0.2.jar;</CODE>'. They are there to prevent the text from exceeding the right side of your screen</I>)</LI>
<LI><B>Initial Folder:</B> <CODE>$FileDir</CODE></LI>
<LI><B>Save all documents first:</B> <CODE>Checked</CODE></LI>
<LI><B>Capture output:</B> <CODE>Checked</CODE></LI>
<LI><B><I>All other checkboxes</I>:</B> Unchecked</LI>
<LI><B>Regular expression to match output:</B> <CODE>^\([^(]+\)(\([0-9]+\),</CODE></LI>
<LI><B>Registers/File:</B> <CODE>1</CODE></LI>
<LI><B>Registers/Line:</B> <CODE>2</CODE></LI>
</UL></LI>
<LI>In the expanded list, select <B>PMD file</B>.</LI>
<LI>In the "tool" form, enter the same parameters as above, except replace '<CODE>$FileDir</CODE>' with '<CODE>$File</CODE>', in the Parameters textbox.</LI>
<LI>To save your work (truly, given a quirk of TextPad), click on <B>OK</B>, which closes the Preferences dialog. Restart TextPad and re-open the Preferences dialog.</LI>
<LI>Go back to both the "PMD directory" and "PMD file" Tools branches, and replace '<CODE>E:\directory\my_pmd_ruleset.xml</CODE>' with the ruleset of your choice. For example, <CODE>rulesets/basic.xml</CODE>.</LI>
<LI>Go to the <B>Keyboard</B> branch in the left pane (above <B>Tools</B>), which changes the right side to the "keyboard configuration" form.</LI>
<LI>In the <B>Categories</B> list box, select <B>Tools</B>.</LI>
<LI>In the <B>Command</B> list box, select <B>PMD directory</B>.</LI>
<LI>Put your cursor into the <B>Press new shortcut key</B>, and type your desired key command. For example <CODE>Ctrl+Page Up</CODE></LI>
<LI>Click <B>Assign</B>.</LI>
<LI>In the <B>Command</B> list box, select <B>PMD file</B>.</LI>
<LI>Put your cursor into the <B>Press new shortcut key</B>, and type your desired key command. For example <CODE>Ctrl+Page Down</CODE></LI>
<LI>Click <B>Assign</B>.</LI>
<LI>Save your work again: Click on <B>OK</B>, which closes the Preferences dialog, and then restart TextPad.</LI>
</OL></P>
<H5><U>To run PMD against a single Java file</U></H5>
<P><OL>
<LI>In TextPad, open any Java file.</LI>
<LI>Click <CODE>Ctrl+Page Down</CODE>. This opens an empty, read-only text document (titled "Command Results"). When PMD completes its analysis, this document will be populated with a listing of violated rules (or "Command completed successfully" indicating no violations).</LI>
<LI>Double click any line to go to it.</LI>
</OL></P>
<H5><U>To run PMD against a directory of Java files</U></H5>
<P><OL>
<LI>In TextPad, open <I>any</I> file in the <I>root</I> directory you wish to analyze. Unfortunately, you'll need to create a dummy file, if no file exists there.</LI>
<LI>Click <CODE>Ctrl+Page Up</CODE>. This opens an empty, read-only text document (titled "Command Results"). When PMD completes its analysis, this document will be populated with a listing of violated rules (or "Command completed successfully" indicating no violations).</LI>
<LI>Double click any line to go to it.</LI>
</OL></P>
<P><I>Because directory analysis may take a while, you may choose to cancel this operation. Do so by closing the (black Command Results) document, and then confirming that, "yes, I do really want to exit the tool".</I></P>
</subsection>
<subsection name="Gel">
<p>Here's how to set up the PMD-Gel plugin:</p>
<ul>