Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: doc/manual/anttask.html

Issue 1232833004: Update findbugs from 3.0.0 to 3.0.1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/findbugs.git@master
Patch Set: rebase again Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « doc/manual/annotations.html ('k') | doc/manual/building.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html><head> 1 <html><head>
2 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 2 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
3 <title>Chapter&nbsp;6.&nbsp;Using the FindBugs&#8482; Ant task</title><meta n ame="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href= "index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" tit le="FindBugs&#8482; Manual"><link rel="prev" href="gui.html" title="Chapter&nbsp ;5.&nbsp;Using the FindBugs GUI"><link rel="next" href="eclipse.html" title="Cha pter&nbsp;7.&nbsp;Using the FindBugs&#8482; Eclipse plugin"></head><body bgcolor ="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class= "navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;6.&nbsp;Using the <span class="application">FindBugs </span>&#8482; <span class="application">Ant</span> task</th></tr><tr><td width= "20%" align="left"><a accesskey="p" href="gui.html">Prev</a>&nbsp;</td><th width ="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesske y="n" href="eclipse.html">Next</a></td></tr></table><hr></div><div class="chapte r" title="Chapter&nbsp;6.&nbsp;Using the FindBugs&#8482; Ant task"><div class="t itlepage"><div><div><h2 class="title"><a name="anttask"></a>Chapter&nbsp;6.&nbsp ;Using the <span class="application">FindBugs</span>&#8482; <span class="applica tion">Ant</span> task</h2></div></div></div><div class="toc"><p><b>Table of Cont ents</b></p><dl><dt><span class="sect1"><a href="anttask.html#d0e1233">1. Instal ling the <span class="application">Ant</span> task</a></span></dt><dt><span clas s="sect1"><a href="anttask.html#d0e1271">2. Modifying build.xml</a></span></dt>< dt><span class="sect1"><a href="anttask.html#d0e1342">3. Executing the task</a>< /span></dt><dt><span class="sect1"><a href="anttask.html#d0e1367">4. Parameters< /a></span></dt></dl></div><p> 3 <title>Chapter&nbsp;6.&nbsp;Using the FindBugs&#8482; Ant task</title><meta n ame="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href= "index.html" title="FindBugs&#8482; Manual"><link rel="up" href="index.html" tit le="FindBugs&#8482; Manual"><link rel="prev" href="gui.html" title="Chapter&nbsp ;5.&nbsp;Using the FindBugs GUI"><link rel="next" href="eclipse.html" title="Cha pter&nbsp;7.&nbsp;Using the FindBugs&#8482; Eclipse plugin"></head><body bgcolor ="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class= "navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&nbsp;6.&nbsp;Using the <span class="application">FindBugs </span>&#8482; <span class="application">Ant</span> task</th></tr><tr><td width= "20%" align="left"><a accesskey="p" href="gui.html">Prev</a>&nbsp;</td><th width ="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesske y="n" href="eclipse.html">Next</a></td></tr></table><hr></div><div class="chapte r"><div class="titlepage"><div><div><h1 class="title"><a name="anttask"></a>Chap ter&nbsp;6.&nbsp;Using the <span class="application">FindBugs</span>&#8482; <spa n class="application">Ant</span> task</h1></div></div></div><div class="toc"><p> <b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="ant task.html#d0e1233">1. Installing the <span class="application">Ant</span> task</ a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1271">2. Modifyin g build.xml</a></span></dt><dt><span class="sect1"><a href="anttask.html#d0e1342 ">3. Executing the task</a></span></dt><dt><span class="sect1"><a href="anttask. html#d0e1367">4. Parameters</a></span></dt></dl></div><p>
4 This chapter describes how to integrate <span class="application">FindBugs</span > into a build script 4 This chapter describes how to integrate <span class="application">FindBugs</span > into a build script
5 for <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="ap plication">Ant</span></a>, which is a popular Java build 5 for <a class="ulink" href="http://ant.apache.org/" target="_top"><span class="ap plication">Ant</span></a>, which is a popular Java build
6 and deployment tool. Using the <span class="application">FindBugs</span> <span class="application">Ant</span> task, your build script can 6 and deployment tool. Using the <span class="application">FindBugs</span> <span class="application">Ant</span> task, your build script can
7 automatically run <span class="application">FindBugs</span> on your Java code. 7 automatically run <span class="application">FindBugs</span> on your Java code.
8 </p><p> 8 </p><p>
9 The <span class="application">Ant</span> task was generously contributed by Mike Fagan. 9 The <span class="application">Ant</span> task was generously contributed by Mike Fagan.
10 </p><div class="sect1" title="1.&nbsp;Installing the Ant task"><div class="title page"><div><div><h2 class="title" style="clear: both"><a name="d0e1233"></a>1.&n bsp;Installing the <span class="application">Ant</span> task</h2></div></div></d iv><p> 10 </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style= "clear: both"><a name="d0e1233"></a>1.&nbsp;Installing the <span class="applicat ion">Ant</span> task</h2></div></div></div><p>
11 To install the <span class="application">Ant</span> task, simply copy <code clas s="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbu gs-ant.jar</code> 11 To install the <span class="application">Ant</span> task, simply copy <code clas s="filename"><em class="replaceable"><code>$FINDBUGS_HOME</code></em>/lib/findbu gs-ant.jar</code>
12 into the <code class="filename">lib</code> subdirectory of your <span class="app lication">Ant</span> installation. 12 into the <code class="filename">lib</code> subdirectory of your <span class="app lication">Ant</span> installation.
13 13
14 </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5i n;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign=" top" width="25"><img alt="[Note]" src="note.png"></td><th align="left">Note</th> </tr><tr><td align="left" valign="top"><p>It is strongly recommended that you us e the <span class="application">Ant</span> task with the version 14 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table bo rder="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="2 5"><img alt="[Note]" src="note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It is strongly recommended that you use the <span c lass="application">Ant</span> task with the version
15 of <span class="application">FindBugs</span> it was included with. We do not gu arantee that the <span class="application">Ant</span> task Jar file 15 of <span class="application">FindBugs</span> it was included with. We do not gu arantee that the <span class="application">Ant</span> task Jar file
16 will work with any version of <span class="application">FindBugs</span> other th an the one it was included with.</p></td></tr></table></div><p> 16 will work with any version of <span class="application">FindBugs</span> other th an the one it was included with.</p></td></tr></table></div><p>
17 </p></div><div class="sect1" title="2.&nbsp;Modifying build.xml"><div class="tit lepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1271"></a>2. &nbsp;Modifying build.xml</h2></div></div></div><p> 17 </p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1271"></a>2.&nbsp;Modifying build.xml</h2></div> </div></div><p>
18 To incorporate <span class="application">FindBugs</span> into <code class="filen ame">build.xml</code> (the build script 18 To incorporate <span class="application">FindBugs</span> into <code class="filen ame">build.xml</code> (the build script
19 for <span class="application">Ant</span>), you first need to add a task definiti on. This should appear as follows: 19 for <span class="application">Ant</span>), you first need to add a task definiti on. This should appear as follows:
20 20
21 </p><pre class="screen"> 21 </p><pre class="screen">
22 &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTas k"/&gt; 22 &lt;taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTas k"/&gt;
23 </pre><p> 23 </pre><p>
24 24
25 The task definition specifies that when a <code class="literal">findbugs</code> element is 25 The task definition specifies that when a <code class="literal">findbugs</code> element is
26 seen in <code class="filename">build.xml</code>, it should use the indicated cla ss to execute the task. 26 seen in <code class="filename">build.xml</code>, it should use the indicated cla ss to execute the task.
27 </p><p> 27 </p><p>
(...skipping 21 matching lines...) Expand all
49 <em class="replaceable"><code>$FINDBUGS_HOME</code></em>. See <a class="xref" h ref="installing.html" title="Chapter&nbsp;2.&nbsp;Installing FindBugs&#8482;">Ch apter&nbsp;2, <i>Installing <span class="application">FindBugs</span>&#8482;</i> </a>. 49 <em class="replaceable"><code>$FINDBUGS_HOME</code></em>. See <a class="xref" h ref="installing.html" title="Chapter&nbsp;2.&nbsp;Installing FindBugs&#8482;">Ch apter&nbsp;2, <i>Installing <span class="application">FindBugs</span>&#8482;</i> </a>.
50 </p><p> 50 </p><p>
51 This target will execute <span class="application">FindBugs</span> on <code clas s="filename">bcel.jar</code>, which is the 51 This target will execute <span class="application">FindBugs</span> on <code clas s="filename">bcel.jar</code>, which is the
52 Jar file produced by BCEL's build script. (By making it depend on the "jar" 52 Jar file produced by BCEL's build script. (By making it depend on the "jar"
53 target, we ensure that the library is fully compiled before running <span class= "application">FindBugs</span> on it.) 53 target, we ensure that the library is fully compiled before running <span class= "application">FindBugs</span> on it.)
54 The output of <span class="application">FindBugs</span> will be saved in XML for mat to a file called 54 The output of <span class="application">FindBugs</span> will be saved in XML for mat to a file called
55 <code class="filename">bcel-fb.xml</code>. 55 <code class="filename">bcel-fb.xml</code>.
56 An auxiliary Jar file, <code class="filename">Regex.jar</code>, is added to the aux classpath, 56 An auxiliary Jar file, <code class="filename">Regex.jar</code>, is added to the aux classpath,
57 because it is referenced by the main BCEL library. A source path is specified 57 because it is referenced by the main BCEL library. A source path is specified
58 so that the saved bug data will have accurate references to the BCEL source code . 58 so that the saved bug data will have accurate references to the BCEL source code .
59 </p></div><div class="sect1" title="3.&nbsp;Executing the task"><div class="titl epage"><div><div><h2 class="title" style="clear: both"><a name="d0e1342"></a>3.& nbsp;Executing the task</h2></div></div></div><p> 59 </p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1342"></a>3.&nbsp;Executing the task</h2></div>< /div></div><p>
60 Here is an example of invoking <span class="application">Ant</span> from the com mand line, using the <code class="literal">findbugs</code> 60 Here is an example of invoking <span class="application">Ant</span> from the com mand line, using the <code class="literal">findbugs</code>
61 target defined above. 61 target defined above.
62 62
63 </p><pre class="screen"> 63 </p><pre class="screen">
64 <code class="prompt">[daveho@noir]$</code> <span class="command"><strong>ant f indbugs</strong></span> 64 <code class="prompt">[daveho@noir]$</code> <span class="command"><strong>ant f indbugs</strong></span>
65 Buildfile: build.xml 65 Buildfile: build.xml
66 66
67 init: 67 init:
68 68
69 compile: 69 compile:
70 70
71 examples: 71 examples:
72 72
73 jar: 73 jar:
74 74
75 findbugs: 75 findbugs:
76 [findbugs] Running FindBugs... 76 [findbugs] Running FindBugs...
77 [findbugs] Bugs were found 77 [findbugs] Bugs were found
78 [findbugs] Output saved to bcel-fb.xml 78 [findbugs] Output saved to bcel-fb.xml
79 79
80 BUILD SUCCESSFUL 80 BUILD SUCCESSFUL
81 Total time: 35 seconds 81 Total time: 35 seconds
82 </pre><p> 82 </pre><p>
83 83
84 In this case, because we saved the bug results in an XML file, we can 84 In this case, because we saved the bug results in an XML file, we can
85 use the <span class="application">FindBugs</span> GUI to view the results; see < a class="xref" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs& #8482;">Chapter&nbsp;4, <i>Running <span class="application">FindBugs</span>&#84 82;</i></a>. 85 use the <span class="application">FindBugs</span> GUI to view the results; see < a class="xref" href="running.html" title="Chapter&nbsp;4.&nbsp;Running FindBugs& #8482;">Chapter&nbsp;4, <i>Running <span class="application">FindBugs</span>&#84 82;</i></a>.
86 </p></div><div class="sect1" title="4.&nbsp;Parameters"><div class="titlepage">< div><div><h2 class="title" style="clear: both"><a name="d0e1367"></a>4.&nbsp;Par ameters</h2></div></div></div><p>This section describes the parameters that may be specified when 86 </p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1367"></a>4.&nbsp;Parameters</h2></div></div></d iv><p>This section describes the parameters that may be specified when
87 using the <span class="application">FindBugs</span> task. 87 using the <span class="application">FindBugs</span> task.
88 88
89 </p><div class="variablelist"><dl><dt><span class="term"><code class="literal">c lass</code></span></dt><dd><p> 89 </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><c ode class="literal">class</code></span></dt><dd><p>
90 A optional nested element specifying which classes to analyze. The <code class="literal">class</code> 90 A optional nested element specifying which classes to analyze. The <code class="literal">class</code>
91 element must specify a <code class="literal">location</code> attribute wh ich names the 91 element must specify a <code class="literal">location</code> attribute wh ich names the
92 archive file (jar, zip, etc.), directory, or class file to be analyzed. Multiple <code class="literal">class</code> 92 archive file (jar, zip, etc.), directory, or class file to be analyzed. Multiple <code class="literal">class</code>
93 elements may be specified as children of a single <code class="literal">f indbugs</code> element. 93 elements may be specified as children of a single <code class="literal">f indbugs</code> element.
94 </p><p>In addition to or instead of specifying a <code class="literal">cl ass</code> element, 94 </p><p>In addition to or instead of specifying a <code class="literal">cl ass</code> element,
95 the <span class="application">FindBugs</span> task can contain one or mo re <code class="literal">fileset</code> element(s) that 95 the <span class="application">FindBugs</span> task can contain one or mo re <code class="literal">fileset</code> element(s) that
96 specify files to be analyzed. 96 specify files to be analyzed.
97 For example, you might use a fileset to specify that all of the jar files in a directory 97 For example, you might use a fileset to specify that all of the jar files in a directory
98 should be analyzed. 98 should be analyzed.
99 </p></dd><dt><span class="term"><code class="literal">auxClasspath</code> </span></dt><dd><p> 99 </p></dd><dt><span class="term"><code class="literal">auxClasspath</code> </span></dt><dd><p>
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 </p></dd><dt><span class="term"><code class="literal">userPreferencesF ile</code></span></dt><dd><p> 209 </p></dd><dt><span class="term"><code class="literal">userPreferencesF ile</code></span></dt><dd><p>
210 Optional attribute. Set the path of the user preferences file to u se, which might override some of the options abobe. 210 Optional attribute. Set the path of the user preferences file to u se, which might override some of the options abobe.
211 Specifying <code class="literal">userPreferencesFile</code> as fir st argument would mean some later 211 Specifying <code class="literal">userPreferencesFile</code> as fir st argument would mean some later
212 options will override them, as last argument would mean they will override some previous options). 212 options will override them, as last argument would mean they will override some previous options).
213 This rationale behind this option is to reuse FindBugs Eclipse pro ject settings for command 213 This rationale behind this option is to reuse FindBugs Eclipse pro ject settings for command
214 line execution. 214 line execution.
215 </p></dd><dt><span class="term"><code class="literal">nested</code>< /span></dt><dd><p> 215 </p></dd><dt><span class="term"><code class="literal">nested</code>< /span></dt><dd><p>
216 Optional attribute which enables or disables scanning of nested ja r and zip files found in 216 Optional attribute which enables or disables scanning of nested ja r and zip files found in
217 the list of files and directories to be analyzed. 217 the list of files and directories to be analyzed.
218 By default, scanning of nested jar/zip files is enabled. 218 By default, scanning of nested jar/zip files is enabled.
219 </p></dd></dl></div><p> 219 </p></dd><dt><span class="term"><code class="literal">setExitCode</cod e></span></dt><dd><p>
220 Optional boolean attribute. Whether the exit code will be returned to
221 the main ant job. Defaults to "true".
222 </p></dd></dl></div><p>
220 223
221 224
222 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigati on footer"><tr><td width="40%" align="left"><a accesskey="p" href="gui.html">Pre v</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align= "right">&nbsp;<a accesskey="n" href="eclipse.html">Next</a></td></tr><tr><td wid th="40%" align="left" valign="top">Chapter&nbsp;5.&nbsp;Using the <span class="a pplication">FindBugs</span> GUI&nbsp;</td><td width="20%" align="center"><a acce sskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="t op">&nbsp;Chapter&nbsp;7.&nbsp;Using the <span class="application">FindBugs</spa n>&#8482; Eclipse plugin</td></tr></table></div></body></html> 225 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigati on footer"><tr><td width="40%" align="left"><a accesskey="p" href="gui.html">Pre v</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align= "right">&nbsp;<a accesskey="n" href="eclipse.html">Next</a></td></tr><tr><td wid th="40%" align="left" valign="top">Chapter&nbsp;5.&nbsp;Using the <span class="a pplication">FindBugs</span> GUI&nbsp;</td><td width="20%" align="center"><a acce sskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="t op">&nbsp;Chapter&nbsp;7.&nbsp;Using the <span class="application">FindBugs</spa n>&#8482; Eclipse plugin</td></tr></table></div></body></html>
OLDNEW
« no previous file with comments | « doc/manual/annotations.html ('k') | doc/manual/building.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698