123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?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" depends="-init-dependencies">
- <path id="libclasspath">
- <fileset dir="lib" includes="*.jar"/>
- </path>
- <taskdef resource="checkstyletask.properties" classpathref="libclasspath"/>
- </target>
-
- <target name="-init-pmd" depends="-init-dependencies">
- <path id="libclasspath">
- <fileset dir="lib" includes="*.jar"/>
- </path>
- <taskdef name="pmd" classpathref="libclasspath" classname="net.sourceforge.pmd.ant.PMDTask" />
- </target>
-
- <target name="-init-cpd" depends="-init-dependencies">
- <path id="libclasspath">
- <fileset dir="lib" includes="*.jar"/>
- </path>
- <taskdef name="cpd" classpathref="libclasspath" classname="net.sourceforge.pmd.cpd.CPDTask" />
- </target>
-
- <target name="-init-findbugs" depends="-init-dependencies">
- <path id="libclasspath">
- <fileset dir="lib" includes="*.jar"/>
- </path>
- <taskdef name="findbugs" classpathref="libclasspath" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
- </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." depends="-init-pmd">
- <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." depends="-init-pmd">
- <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." depends="-init-cpd">
- <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="-init-findbugs,jar" description="Run Findbugs.">
- <mkdir dir="reports/findbugs" />
- <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>
|