12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?xml version="1.0" encoding="UTF-8"?>
- <project name="DMDirc-reports" default="default" basedir=".">
- <description>Checkstyle, findbugs, CPD and PMD reports</description>
-
- <target name="doallreports" depends="test-both,-allreports,javadoc"
- description="Run all reports." />
- <target name="domostreports" depends="test-both,-mostreports,javadoc"
- description="Run all reports except Findbugs." />
-
- <target name="checkstyle" depends="checkstyle-all, -move-index" description="Run checkstyle." />
-
- <target name="-allreports" depends="findbugs, cpd, pmd, checkstyle" />
- <target name="-mostreports" depends="cpd, pmd, checkstyle" />
-
- <target name="-init-checkstyle">
- <taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-5.3-all.jar"/>
- </target>
-
- <target name="checkstyle-all" depends="-init-checkstyle">
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure" failOnViolation="false">
- <fileset dir="src/" includes="**/*.java" excludes="net/miginfocom/**"/>
- <fileset dir="modules/plugins/src/" includes="**/*.java"/>
- <fileset dir="modules/parser/src/" includes="**/*.java"/>
- <fileset dir="modules/util/src/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/checkstyle.xml"/>
- </checkstyle>
- <xslt in="reports/checkstyle.xml" out="reports/checkstyle.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="-move-index">
- <!-- <copy file="checkstyle/index.html" tofile="reports/index.html"/> -->
- <copy file="checkstyle/sorttable.js" tofile="reports/sorttable.js"/>
- </target>
-
- <target name="pmd" description="Run PMD.">
- <taskdef name="pmd" classpath="lib/pmd-4.2.5.jar:lib/jaxen-1.1.1.jar:lib/asm-3.1.jar"
- classname="net.sourceforge.pmd.ant.PMDTask" />
- <pmd shortFilenames="true">
-
- <ruleset>checkstyle/pmd_checks.xml</ruleset>
- <formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
- <fileset dir="src/" includes="com/dmdirc/**/*.java" />
- <fileset dir="modules/plugins/src/" includes="com/dmdirc/**/*.java"/>
- <fileset dir="modules/util/src/" includes="com/dmdirc/**/*.java"/>
- <fileset dir="modules/parser/src/" includes="com/dmdirc/**/*.java"/>
- </pmd>
- <xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
- </target>
-
- <target name="pmd-minimal" description="Run PMD with minimal ruleset.">
- <taskdef name="pmd" classpath="lib/pmd-4.2.5.jar:lib/jaxen-1.1.1.jar:lib/asm-3.1.jar"
- classname="net.sourceforge.pmd.ant.PMDTask" />
- <pmd shortFilenames="true">
-
- <ruleset>checkstyle/pmd_minimal.xml</ruleset>
- <formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
- <fileset dir="src/" includes="com/dmdirc/**/*.java" />
- <fileset dir="modules/plugins/src/" includes="com/dmdirc/**/*.java"/>
- <fileset dir="modules/util/src/" includes="com/dmdirc/**/*.java"/>
- <fileset dir="modules/parser/src/" includes="com/dmdirc/**/*.java"/>
- </pmd>
- <xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
- </target>
-
- <target name="cpd" description="Run CPD.">
- <taskdef name="cpd" classpath="lib/pmd-4.2.5.jar:lib/jaxen-1.1.1.jar:lib/asm-3.1.jar" classname="net.sourceforge.pmd.cpd.CPDTask" />
-
- <cpd format="xml" minimumTokenCount="50" outputFile="reports/report-cpd.xml">
- <fileset dir="src/com/">
- <include name="**/*.java"/>
- </fileset>
- </cpd>
- <xslt in="reports/report-cpd.xml" style="checkstyle/cpd.xslt" out="reports/report-cpd.html" />
- </target>
-
- <target name="findbugs" depends="jar" description="Run Findbugs.">
- <mkdir dir="reports/findbugs" />
- <taskdef name="findbugs" classpath="lib/findbugs-ant.jar" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
- <findbugs home="/usr/share/java/findbugs/" effort="max"
- jvmargs="-Xmx512M"
- output="xml:withMessages"
- outputFile="reports/findbugs/report-fb.xml" reportLevel="low">
- <sourcePath path="src/" />
- <class location="dist/DMDirc.jar" />
- </findbugs>
- <xslt in="reports/findbugs/report-fb.xml" style="checkstyle/findbugs.xslt" out="reports/report-fb.html" />
- </target>
- </project>
|