You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by vi...@apache.org on 2015/11/07 20:53:38 UTC
svn commit: r1713168 - in /tomcat/trunk: BUILDING.txt
build.properties.default build.xml
Author: violetagg
Date: Sat Nov 7 19:53:38 2015
New Revision: 1713168
URL: http://svn.apache.org/viewvc?rev=1713168&view=rev
Log:
Add findbugs to the build. It is off by default.
Modified:
tomcat/trunk/BUILDING.txt
tomcat/trunk/build.properties.default
tomcat/trunk/build.xml
Modified: tomcat/trunk/BUILDING.txt
URL: http://svn.apache.org/viewvc/tomcat/trunk/BUILDING.txt?rev=1713168&r1=1713167&r2=1713168&view=diff
==============================================================================
--- tomcat/trunk/BUILDING.txt (original)
+++ tomcat/trunk/BUILDING.txt Sat Nov 7 19:53:38 2015
@@ -420,6 +420,18 @@ For example:
java.net.preferIPv4Stack=true
+ 9. Optional support is provided for FindBugs. It can be enabled using the
+ following property:
+
+ execute.findbugs=true
+
+ The report file by default is written to
+
+ output/findbugs
+
+* NOTE: Findbugs is licensed under LGPL. Using Findbugs during Tomcat build is
+ optional and is off by default.
+
(8) Source code checks
(8.1) Checkstyle
Modified: tomcat/trunk/build.properties.default
URL: http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1713168&r1=1713167&r2=1713168&view=diff
==============================================================================
--- tomcat/trunk/build.properties.default (original)
+++ tomcat/trunk/build.properties.default Sat Nov 7 19:53:38 2015
@@ -50,6 +50,9 @@ test.threads=1
# Note the Cobertura code coverage tool is GPLv2 licensed
test.cobertura=false
+# Note the FindBugs is LGPL licensed
+execute.findbugs=false
+
# Some platforms (e.g. OSX El Capitan) require IPv4 to be the default for the
# multicast tests to work
java.net.preferIPv4Stack=false
@@ -226,3 +229,10 @@ cobertura.home=${base.path}/cobertura-${
cobertura.jar=${cobertura.home}/cobertura-${cobertura.version}.jar
cobertura.lib=${cobertura.home}/lib
cobertura.loc=${base-sf.loc}/cobertura/cobertura-2.1.1-bin.tar.gz
+
+# ----- Findbugs -----
+findbugs.version=3.0.1
+findbugs.home=${base.path}/findbugs-${findbugs.version}
+findbugs.lib=${findbugs.home}/lib
+findbugs.jar=${findbugs.lib}/findbugs-ant.jar
+findbugs.loc=${base-sf.loc}/project/findbugs/findbugs/${findbugs.version}/findbugs-${findbugs.version}.tar.gz
Modified: tomcat/trunk/build.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1713168&r1=1713167&r2=1713168&view=diff
==============================================================================
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Sat Nov 7 19:53:38 2015
@@ -180,6 +180,11 @@
<property name="tomcat.classes.cobertura" value="${tomcat.classes}-cobertura"/>
<property name="cobertura.report.format" value="html"/>
+ <!-- FindBugs settings -->
+ <property name="findbugs.out" value="${tomcat.output}/findbugs"/>
+ <property name="findbugs.report.format" value="html"/>
+ <property name="findbugs.report.level" value="low"/>
+
<!-- Workaround against http://bugs.sun.com/view_bug.do?bug_id=6202721 -->
<available file="/dev/urandom" property="test.jvmarg.egd" value="-Djava.security.egd=file:/dev/./urandom"/>
<property name="test.jvmarg.egd" value="" />
@@ -1564,6 +1569,32 @@
format="${cobertura.report.format}"/>
</target>
+ <target name="findbugs"
+ if="${execute.findbugs}"
+ depends="compile,download-findbugs">
+
+ <path id="findbugs.classpath">
+ <fileset file="${findbugs.jar}" />
+ </path>
+
+ <taskdef classpathref="findbugs.classpath" name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>
+
+ <mkdir dir="${findbugs.out}" />
+
+ <findbugs home="${findbugs.home}"
+ output="${findbugs.report.format}"
+ outputFile="${findbugs.out}/findbugs-report.${findbugs.report.format}"
+ reportLevel="${findbugs.report.level}"
+ excludeFilter="res/findbugs/filter-false-positives.xml" >
+ <sourcePath path="${basedir}/java" />
+ <class location="${tomcat.classes}" />
+ <auxClasspath>
+ <fileset file="${jdt.jar}" />
+ <fileset file="${ant.core.lib}" />
+ </auxClasspath>
+ </findbugs>
+ </target>
+
<target name="extras-prepare" >
<mkdir dir="${tomcat.extras}"/>
<mkdir dir="${tomcat.extras.sources}"/>
@@ -2860,6 +2891,17 @@ skip.installer property in build.propert
</antcall>
</target>
+
+ <target name="download-findbugs"
+ if="${execute.findbugs}"
+ description="Download FindBugs" >
+
+ <antcall target="downloadgz">
+ <param name="sourcefile" value="${findbugs.loc}"/>
+ <param name="destfile" value="${findbugs.jar}"/>
+ </antcall>
+
+ </target>
<target name="download-dist"
description="Download additional components for a distribution" >
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org