-
Notifications
You must be signed in to change notification settings - Fork 23
/
findbugs.build.xml
37 lines (31 loc) · 1.81 KB
/
findbugs.build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<project name="findbugs" default="findbugs">
<description>
Provides the FindBugs tool and the Hackystat FindBugs sensor.
</description>
<import file="build.xml" />
<property environment="env" />
<property name="findbugs.dir" location="${build.dir}/findbugs" />
<target name="findbugs" depends="findbugs.tool, findbugs.report" description="Runs the FindBugs tool, report, and sensor." />
<target name="findbugs.tool" depends="compile" description="Runs FindBugs over the byte code to check for problems.">
<!-- Fail this target if FindBugs is not installed. -->
<available file="${env.FINDBUGS_HOME}/lib/findbugs.jar" property="findbugs.available" />
<fail unless="findbugs.available" message="Error: FINDBUGS_HOME not set or findbugs.jar not found." />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${env.FINDBUGS_HOME}/lib/findbugs-ant.jar" />
<!-- Run FindBugs. -->
<mkdir dir="${findbugs.dir}" />
<findbugs home="${env.FINDBUGS_HOME}" failOnError="${findbugs.failOnError}" warningsProperty="findbugs.warningsfound" output="xml:withMessages" outputFile="${findbugs.dir}/findbugs.xml" excludeFilter="${basedir}/lib/findbugs/hackystat.findbugs.exclude.xml">
<auxClasspath>
<path refid="compile.classpath" />
</auxClasspath>
<sourcePath>
<fileset dir="${src.dir}">
<include name="**/*.java" />
</fileset>
</sourcePath>
<class location="${build.dir}/classes" />
</findbugs>
</target>
<target name="findbugs.report" depends="findbugs.tool" description="Generate an HTML report on FindBugs.">
<xslt in="${findbugs.dir}/findbugs.xml" style="${env.FINDBUGS_HOME}/src/xsl/default.xsl" out="${findbugs.dir}/findbugs-default.html" />
</target>
</project>