123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <?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, checkstyle-actions,
- checkstyle-core,
- checkstyle-commandparser,
- checkstyle-config, checkstyle-logger,
- checkstyle-parser, checkstyle-plugins,
- checkstyle-ui, -remove-xml-files,
- -move-index"
- description="Run checkstyle." />
-
- <target name="-allreports" depends="findbugs, cpd, pmd, checkstyle" />
- <target name="-mostreports" depends="cpd, pmd, checkstyle" />
-
- <target name="checkstyle-plugins">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle-all-4.3.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="src/com/dmdirc/plugins/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-plugins.xml"/>
-
- </checkstyle>
- <xslt in="reports/report-plugins.xml" out="reports/report-plugins.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="checkstyle-actions">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="src/com/dmdirc/actions/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-actions.xml"/>
-
- </checkstyle>
- <xslt in="reports/report-actions.xml" out="reports/report-actions.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="checkstyle-ui">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="src/com/dmdirc/ui/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-ui.xml"/>
- </checkstyle>
-
- <xslt in="reports/report-ui.xml" out="reports/report-ui.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="checkstyle-parser">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="modules/parser/src/com/dmdirc/parser/irc/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-parser.xml"/>
- </checkstyle>
- <xslt in="reports/report-parser.xml" out="reports/report-parser.html" style="checkstyle/checkstyle.xsl"/>
-
- </target>
-
- <target name="checkstyle-addons">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="modules/addons/src/com/dmdirc/addons/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-addons.xml"/>
- </checkstyle>
- <xslt in="reports/report-addons.xml" out="reports/report-addons.html" style="checkstyle/checkstyle.xsl"/>
-
- </target>
-
- <target name="checkstyle-logger">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="src/com/dmdirc/logger/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-logger.xml"/>
- </checkstyle>
- <xslt in="reports/report-logger.xml" out="reports/report-logger.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
-
- <target name="checkstyle-config">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="src/com/dmdirc/config/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-config.xml"/>
- </checkstyle>
- <xslt in="reports/report-config.xml" out="reports/report-config.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="checkstyle-commandparser">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="src/com/dmdirc/commandparser/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-commandparser.xml"/>
- </checkstyle>
- <xslt in="reports/report-commandparser.xml" out="reports/report-commandparser.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="checkstyle-core">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
-
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
- <fileset dir="src/com/dmdirc/" includes="*.java"/>
- <formatter type="xml" tofile="reports/report-core.xml"/>
- </checkstyle>
- <xslt in="reports/report-core.xml" out="reports/report-core.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="checkstyle-all">
- <taskdef resource="checkstyletask.properties"
- classpath="checkstyle.jar"/>
- <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
- failOnViolation="false">
-
- <fileset dir="src/com/dmdirc/" includes="**/*.java"/>
- <formatter type="xml" tofile="reports/report-all.xml"/>
- </checkstyle>
- <xslt in="reports/report-all.xml" out="reports/report-all.html" style="checkstyle/checkstyle.xsl"/>
- </target>
-
- <target name="-remove-xml-files">
- <delete>
- <fileset dir="reports/" includes="*.xml"/>
- </delete>
- </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="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>
|