Added a findbugs ant target, along with an installDeps job to automatically fetch and unpack findbugs from its sourceforge repository. Still need to figure out how to maintain a list of findbugs warnings that findbugs should be ignoring.

This commit is contained in:
Reinier Zwitserloot committed 2009-11-08 22:09:49 +01:00
1 parent 56602322d9
commit 9830a2ba02
5 files changed
+118

No files matched your search

+32
View File
@@ -48,12 +48,44 @@ lombok code including the various agents.
</fileset>
</path>
<path id="findbugs_deps.path">
<fileset dir="deps/buildScripts/findbugs">
<include name="**/*.jar" />
</fileset>
</path>
<target name="-unpackLibs">
<unjar dest="build/lombok">
<path refid="libs.path" />
</unjar>
</target>
<target name="-check-findbugs">
<available property="findbugs.available" file="deps/buildScripts/findbugs/bin/findbugs" />
<fail unless="findbugs.available" message="You don't have findbugs available. Run 'ant installDeps' to fetch it." />
</target>
<target name="findbugs" depends="-check-findbugs, dist" description="Runs findbugs on the lombok sources">
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs_deps.path" />
<mkdir dir="build/lombok_aux" />
<!-- This ridiculous waste of time (unpacking ALL deps, which is a lot of data!) is done because the ant findbugs task is
a retarded stepchild; it does not understand either pathrefs or wildcards (*.jar), and hardcoding the names of the various
eclipse module jars would be even worse. -->
<unjar dest="build/lombok_aux">
<fileset dir="deps/lombok">
<include name="**/*.jar" />
</fileset>
</unjar>
<findbugs home="deps/buildScripts/findBugs" output="html" outputFile="findbugsReport.html" jvmargs="-Xmx512m">
<auxClasspath path="build/lombok" />
<auxClasspath path="build/lombok_aux" />
<sourcePath path="src" />
<sourcePath path="src_eclipseagent" />
<class location="build/lombok/lombok" />
</findbugs>
</target>
<target name="compile" description="Compiles the code">
<mkdir dir="build/lombok" />
<!-- ant includes the destination dir on the classpath (and there are good reason to do this), but that also means