| @@ -48,13 +48,16 @@ | |||||
| <property name="checkstyle.src.dir" location="${etc.dir}/checkstyle"/> | <property name="checkstyle.src.dir" location="${etc.dir}/checkstyle"/> | ||||
| <!-- Ant Checkstyle report --> | |||||
| <!-- Ant Checkstyle --> | |||||
| <property name="checkstyle.version" | |||||
| value="6.19" | |||||
| description="Which version of Checkstyle to use"/> | |||||
| <property name="checkstyle.reportdir" | <property name="checkstyle.reportdir" | ||||
| location="${build.dir}/reports/checkstyle" | location="${build.dir}/reports/checkstyle" | ||||
| description="Where to store Checkstyle reports"/> | description="Where to store Checkstyle reports"/> | ||||
| <property name="checkstyle.raw" | <property name="checkstyle.raw" | ||||
| location="${checkstyle.reportdir}/raw.xml" | location="${checkstyle.reportdir}/raw.xml" | ||||
| description="Name of Checkstyle XML-Report"/> | |||||
| description="Name of Checkstyle XML report"/> | |||||
| <property name="stylesheet.html" | <property name="stylesheet.html" | ||||
| location="${checkstyle.src.dir}/checkstyle-frames.xsl" | location="${checkstyle.src.dir}/checkstyle-frames.xsl" | ||||
| description="Name of Checkstyle XSLT for generating HTML"/> | description="Name of Checkstyle XSLT for generating HTML"/> | ||||
| @@ -75,30 +78,33 @@ | |||||
| value="**/*.java" | value="**/*.java" | ||||
| description="Include pattern of the files to check"/> | description="Include pattern of the files to check"/> | ||||
| <!-- Findbugs: Running Findbugs --> | |||||
| <!-- Findbugs: Running SpotBugs --> | |||||
| <property name="spotbugs.version" | |||||
| value="3.1.4" | |||||
| description="Which version of SpotBugs to use"/> | |||||
| <property name="findbugs.reportdir" | <property name="findbugs.reportdir" | ||||
| location="${build.dir}/reports/findbugs" | location="${build.dir}/reports/findbugs" | ||||
| description="Where to store Findbugs results"/> | |||||
| description="Where to store SpotBugs results"/> | |||||
| <property name="findbugs.raw" | <property name="findbugs.raw" | ||||
| value="raw.xml" | value="raw.xml" | ||||
| description="Findbugs Output xml-file"/> | |||||
| description="Name of SpotBugs XML report"/> | |||||
| <property name="findbugs.xsl" | <property name="findbugs.xsl" | ||||
| value="fancy.xsl" | value="fancy.xsl" | ||||
| description="Which XSL to use for generating Output: default, fancy, plain, summary"/> | |||||
| description="Which XSL to use for generating output: default, fancy, plain, summary"/> | |||||
| <property name="findbugs.jvmargs" | <property name="findbugs.jvmargs" | ||||
| value="-Xms128m -Xmx512m" | value="-Xms128m -Xmx512m" | ||||
| description="JVMArgs for invoking Findbugs"/> | |||||
| description="JVM arguments when invoking SpotBugs"/> | |||||
| <!-- RAT Release Auditing Tool --> | |||||
| <!-- Apache Rat: Release Auditing Tool --> | |||||
| <property name="rat.version" | |||||
| value="0.12" | |||||
| description="Which version of Apache Rat to use"/> | |||||
| <property name="rat.report.dir" | <property name="rat.report.dir" | ||||
| value="${build.dir}/reports/rat" | value="${build.dir}/reports/rat" | ||||
| description="Where to store the RAT reports"/> | |||||
| description="Where to store Apache Rat reports"/> | |||||
| <property name="rat.report.file" | <property name="rat.report.file" | ||||
| value="${rat.report.dir}/report.html" | value="${rat.report.dir}/report.html" | ||||
| description="RAT-Report file"/> | |||||
| <property name="rat.version" | |||||
| value="0.12" | |||||
| description="Which Version of RAT to use"/> | |||||
| description="Name of Apache Rat report"/> | |||||
| <!-- Simian --> | <!-- Simian --> | ||||
| <property name="simian.version" | <property name="simian.version" | ||||
| @@ -115,6 +121,9 @@ | |||||
| description="Where to store Simian reports"/> | description="Where to store Simian reports"/> | ||||
| <!-- OWASP Dependency Check --> | <!-- OWASP Dependency Check --> | ||||
| <property name="owasp.dc.version" | |||||
| value="3.2.1" | |||||
| description="Which version of OWASP Dependency Check to use"/> | |||||
| <property name="owasp.dc.report.dir" | <property name="owasp.dc.report.dir" | ||||
| value="${build.dir}/reports/owasp-dc" | value="${build.dir}/reports/owasp-dc" | ||||
| description="Where to store the OWASP Dependency Check reports"/> | description="Where to store the OWASP Dependency Check reports"/> | ||||
| @@ -141,8 +150,8 @@ | |||||
| Skip running Checkstyle. | Skip running Checkstyle. | ||||
| </echo> | </echo> | ||||
| <sequential unless:set="antlr.present"> | <sequential unless:set="antlr.present"> | ||||
| <ivy:cachepath organisation="com.puppycrawl.tools" module="checkstyle" revision="6.19" | |||||
| inline="true" conf="default" pathid="checkstyle.classpath" transitive="true"/> | |||||
| <ivy:cachepath organisation="com.puppycrawl.tools" module="checkstyle" revision="${checkstyle.version}" | |||||
| inline="true" conf="default" pathid="checkstyle.classpath"/> | |||||
| <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" classpathref="checkstyle.classpath"/> | <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" classpathref="checkstyle.classpath"/> | ||||
| <mkdir dir="${checkstyle.reportdir}"/> | <mkdir dir="${checkstyle.reportdir}"/> | ||||
| <checkstyle config="${checkstyle.src.dir}/checkstyle-config" failOnViolation="false"> | <checkstyle config="${checkstyle.src.dir}/checkstyle-config" failOnViolation="false"> | ||||
| @@ -182,7 +191,7 @@ | |||||
| <target name="xdocreport" description="--> generates a xdoc checkstyle report" unless="antlr.present"> | <target name="xdocreport" description="--> generates a xdoc checkstyle report" unless="antlr.present"> | ||||
| <xslt in="${checkstyle.raw}" style="${stylesheet.xdoc}" | <xslt in="${checkstyle.raw}" style="${stylesheet.xdoc}" | ||||
| out="${checkstyle.reportdir}/xdocs/index.xml"> | |||||
| out="${checkstyle.reportdir}/xdocs/index.xml"> | |||||
| <param name="basedir" expression="${checkstyle.basedir}"/> | <param name="basedir" expression="${checkstyle.basedir}"/> | ||||
| </xslt> | </xslt> | ||||
| </target> | </target> | ||||
| @@ -241,34 +250,22 @@ | |||||
| <fixcrlf srcdir="src/main" includes="${path}" javafiles="yes" tab="remove" tablength="4"/> | <fixcrlf srcdir="src/main" includes="${path}" javafiles="yes" tab="remove" tablength="4"/> | ||||
| </target> | </target> | ||||
| <target name="findbugs" description="--> checks Ant codebase with Findbugs" depends="init-ivy,build" | |||||
| <target name="findbugs" description="--> checks Ant codebase with SpotBugs" depends="init-ivy,build" | |||||
| xmlns:fb="http://findbugs.sourceforge.net/"> | xmlns:fb="http://findbugs.sourceforge.net/"> | ||||
| <property name="spotbugs.dir" value="build/download/spotbugs"/> | |||||
| <property name="spotbugs.ver" value="3.1.3"/> | |||||
| <ivy:cachefileset organisation="com.github.spotbugs" module="spotbugs-ant" revision="${spotbugs.ver}" | |||||
| inline="true" setid="spotbugs.fileset"/> | |||||
| <!-- Hardcoded paths --> | |||||
| <mkdir dir="${spotbugs.dir}/lib"/> | |||||
| <copy todir="${spotbugs.dir}/lib"> | |||||
| <flattenmapper/> | |||||
| <fileset refid="spotbugs.fileset"/> | |||||
| </copy> | |||||
| <delete dir="${spotbugs.dir}/lib" includes="ant-*,*-javadoc.jar,*-sources.jar"/> | |||||
| <!-- Hardcoded names --> | |||||
| <symlink resource="spotbugs-${spotbugs.ver}.jar" link="${spotbugs.dir}/lib/spotbugs.jar"/> | |||||
| <symlink resource="spotbugs-annotations-${spotbugs.ver}.jar" | |||||
| link="${spotbugs.dir}/lib/spotbugs-annotations.jar"/> | |||||
| <!-- Path is provided through CLI to forked JVM --> | |||||
| <!-- Path of optional libs is provided through CLI to forked JVM --> | |||||
| <path id="optional.libs"> | <path id="optional.libs"> | ||||
| <fileset dir="lib/optional" includes="*.jar"/> | <fileset dir="lib/optional" includes="*.jar"/> | ||||
| </path> | </path> | ||||
| <!-- Load the Findbugs AntTasks --> | |||||
| <ivy:cachepath organisation="com.github.spotbugs" module="spotbugs-ant" revision="${spotbugs.version}" | |||||
| inline="true" conf="default" pathid="spotbugs.classpath"/> | |||||
| <!-- Load the SpotBugs AntTasks --> | |||||
| <taskdef uri="http://findbugs.sourceforge.net/" resource="edu/umd/cs/findbugs/anttask/tasks.properties" | <taskdef uri="http://findbugs.sourceforge.net/" resource="edu/umd/cs/findbugs/anttask/tasks.properties" | ||||
| classpath="${spotbugs.dir}/lib/spotbugs-ant-${spotbugs.ver}.jar"/> | |||||
| classpathref="spotbugs.classpath"/> | |||||
| <!-- Start Findbugs --> | |||||
| <!-- Start SpotBugs --> | |||||
| <mkdir dir="${findbugs.reportdir}"/> | <mkdir dir="${findbugs.reportdir}"/> | ||||
| <fb:spotbugs home="${spotbugs.dir}" | |||||
| <fb:spotbugs classpathref="spotbugs.classpath" | |||||
| output="xml:withMessages" | output="xml:withMessages" | ||||
| outputFile="${findbugs.reportdir}/${findbugs.raw}" | outputFile="${findbugs.reportdir}/${findbugs.raw}" | ||||
| jvmargs="${findbugs.jvmargs}" | jvmargs="${findbugs.jvmargs}" | ||||
| @@ -281,14 +278,14 @@ | |||||
| <!-- Generate (human) readable output --> | <!-- Generate (human) readable output --> | ||||
| <xslt basedir="${findbugs.reportdir}" includes="${findbugs.raw}" destdir="${findbugs.reportdir}"> | <xslt basedir="${findbugs.reportdir}" includes="${findbugs.raw}" destdir="${findbugs.reportdir}"> | ||||
| <style> | <style> | ||||
| <javaresource name="${findbugs.xsl}" classpath="${spotbugs.dir}/lib/spotbugs-${spotbugs.ver}.jar"/> | |||||
| <javaresource name="${findbugs.xsl}" classpathref="spotbugs.classpath"/> | |||||
| </style> | </style> | ||||
| </xslt> | </xslt> | ||||
| </target> | </target> | ||||
| <target name="rat" description="--> Runs the ReleaseAuditingTool" depends="init-ivy"> | <target name="rat" description="--> Runs the ReleaseAuditingTool" depends="init-ivy"> | ||||
| <ivy:cachepath organisation="org.apache.rat" module="apache-rat-tasks" revision="${rat.version}" | <ivy:cachepath organisation="org.apache.rat" module="apache-rat-tasks" revision="${rat.version}" | ||||
| inline="true" conf="default" pathid="rat.classpath" transitive="true"/> | |||||
| inline="true" conf="default" pathid="rat.classpath"/> | |||||
| <typedef resource="org/apache/rat/anttasks/antlib.xml" | <typedef resource="org/apache/rat/anttasks/antlib.xml" | ||||
| uri="antlib:org.apache.rat.anttasks" | uri="antlib:org.apache.rat.anttasks" | ||||
| classpathref="rat.classpath"/> | classpathref="rat.classpath"/> | ||||
| @@ -301,11 +298,11 @@ | |||||
| </rat:report> | </rat:report> | ||||
| </target> | </target> | ||||
| <target name="dependency-check" description="--> Runs the OWASP dependency check" depends="init-ivy"> | |||||
| <ivy:cachepath organisation="org.owasp" module="dependency-check-ant" revision="3.2.1" | |||||
| inline="true" conf="default" pathid="dc.classpath" transitive="true"/> | |||||
| <target name="dependency-check" description="--> Runs the OWASP Dependency Check" depends="init-ivy"> | |||||
| <ivy:cachepath organisation="org.owasp" module="dependency-check-ant" revision="${owasp.dc.version}" | |||||
| inline="true" conf="default" pathid="owasp.dc.classpath"/> | |||||
| <taskdef resource="dependency-check-taskdefs.properties" uri="https://jeremylong.github.io/" | <taskdef resource="dependency-check-taskdefs.properties" uri="https://jeremylong.github.io/" | ||||
| classpathref="dc.classpath"/> | |||||
| classpathref="owasp.dc.classpath"/> | |||||
| <mkdir dir="${owasp.dc.report.dir}"/> | <mkdir dir="${owasp.dc.report.dir}"/> | ||||
| <owasp:dependency-check xmlns:owasp="https://jeremylong.github.io/" | <owasp:dependency-check xmlns:owasp="https://jeremylong.github.io/" | ||||
| projectName="${ant.project.name}" | projectName="${ant.project.name}" | ||||