Author: jhm
Date: Wed Oct 8 04:38:29 2008
New Revision: 702813
URL: http://svn.apache.org/viewvc?rev=702813&view=rev
Log:
Prepare for introducing Findbugs.
Problem: current version (1.3.5) is not in the Maven repositories (as
requested).
Modified:
ant/core/trunk/check.xml
Modified: ant/core/trunk/check.xml
URL:
http://svn.apache.org/viewvc/ant/core/trunk/check.xml?rev=702813&r1=702812&r2=702813&view=diff
==============================================================================
--- ant/core/trunk/check.xml (original)
+++ ant/core/trunk/check.xml Wed Oct 8 04:38:29 2008
@@ -134,6 +134,78 @@
<condition><not><isset property="path"/></not></condition>
</fail>
<fixcrlf srcdir="src/main" includes="${path}" javafiles="yes"
tab="remove" tablength="4"/>
- </target>
-
-</project>
\ No newline at end of file
+ </target>
+
+
+
+
+
+ <property name="findbugs.reportdir"
+ location="${build.dir}/reports/findbugs"
+ description="Where to store Findbugs results"/>
+ <property name="findbugs.raw"
+ value="raw.xml"
+ description="Findbugs Output xml-file"/>
+ <property name="findbugs.plugins"
+ value=""
+ description="Which Findbugs plugin to run"/>
+ <property name="findbugs.xsl"
+ value="fancy.xsl"
+ description="Which XSL to use for generating Output: default,
fancy, plain, summary"/>
+ <property name="findbugs.jvmargs"
+ value="-Xms128m -Xmx512m"
+ description="JVMArgs for invoking Findbugs"/>
+
+
+
+ <target name="findbugs" description="--> checks Ant codebase with Findbugs"
depends="init-ivy" xmlns:fb="http://findbugs.sourceforge.net/">
+ <!-- Getting Findbugs -->
+ <!--
+ RFE : [2114752] Put 1.3.5 in Maven repository
+
http://sourceforge.net/tracker/index.php?func=detail&aid=2114752&group_id=96405&atid=614693
+ Currently (2008-10-07 the newest one is 1.0.0)
+ -->
+ <ivy:cachepath organisation="findbugs" module="findbugs" revision="1.0.0"
+ inline="true" conf="default" pathid="findbugs.classpath"
transitive="true"/>
+ <!-- Findbugs needs Dom4J, but doesnt declare it in its pom -->
+ <ivy:cachepath organisation="dom4j" module="dom4j" revision="1.6.1"
+ inline="true" conf="default" pathid="dom4j.classpath"
transitive="true"/>
+ <!-- Getting Findbugs Plugins -->
+ <ivy:cachepath organisation="findbugs" module="coreplugin" revision="1.0.0"
+ inline="true" conf="default" pathid="findbugs.plugin.1"
transitive="true"/>
+
+ <!-- Create a path using both downloads -->
+ <path id="findbugs.real.classpath">
+ <path refid="findbugs.classpath"/>
+ <path refid="dom4j.classpath"/>
+ </path>
+ <!-- Path for Findbugs PlugIns -->
+ <path id="findbugs.plugins.classpath">
+ <!--
+ <path refid="findbugs.plugin.1"/>
+ -->
+ </path>
+
+ <!-- Load the Findbugs AntTasks -->
+ <taskdef uri="http://findbugs.sourceforge.net/"
resource="edu/umd/cs/findbugs/anttask/tasks.properties"
classpathref="findbugs.real.classpath" />
+
+ <!-- Start Findbugs -->
+ <mkdir dir="${findbugs.reportdir}"/>
+ <fb:findbugs classpathref="findbugs.real.classpath"
pluginlist="${findbugs.plugins}"
+ output="xml:withMessages"
+ outputFile="${findbugs.reportdir}/${findbugs.raw}"
+ jvmargs="${findbugs.jvmargs}">
+ <class location="${build.classes}" />
+ <sourcePath path="${java.dir}" />
+ <pluginlist refid="findbugs.plugins.classpath"/>
+ </fb:findbugs>
+
+ <!-- Generate (human) readable output -->
+ <xslt basedir="${findbugs.reportdir}" includes="${findbugs.raw}"
destdir="${findbugs.reportdir}">
+ <style>
+ <javaresource name="${findbugs.xsl}"
classpathref="findbugs.real.classpath"/>
+ </style>
+ </xslt>
+ </target>
+
+</project>