You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-reports.xml 4.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="DMDirc-reports" default="default" basedir=".">
  3. <description>Checkstyle, findbugs, CPD and PMD reports</description>
  4. <target name="doallreports" depends="test-both,-allreports,javadoc"
  5. description="Run all reports." />
  6. <target name="domostreports" depends="test-both,-mostreports,javadoc"
  7. description="Run all reports except Findbugs." />
  8. <target name="checkstyle" depends="checkstyle-all, -move-index" description="Run checkstyle." />
  9. <target name="-allreports" depends="findbugs, cpd, pmd, checkstyle" />
  10. <target name="-mostreports" depends="cpd, pmd, checkstyle" />
  11. <target name="-init-checkstyle">
  12. <taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-5.3-all.jar"/>
  13. </target>
  14. <target name="checkstyle-all" depends="-init-checkstyle">
  15. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure" failOnViolation="false">
  16. <fileset dir="src/" includes="**/*.java" excludes="net/miginfocom/**"/>
  17. <fileset dir="modules/plugins/src/" includes="**/*.java"/>
  18. <fileset dir="modules/parser/src/" includes="**/*.java"/>
  19. <fileset dir="modules/util/src/" includes="**/*.java"/>
  20. <formatter type="xml" tofile="reports/checkstyle.xml"/>
  21. </checkstyle>
  22. <xslt in="reports/checkstyle.xml" out="reports/checkstyle.html" style="checkstyle/checkstyle.xsl"/>
  23. </target>
  24. <target name="-move-index">
  25. <!-- <copy file="checkstyle/index.html" tofile="reports/index.html"/> -->
  26. <copy file="checkstyle/sorttable.js" tofile="reports/sorttable.js"/>
  27. </target>
  28. <target name="pmd" description="Run PMD.">
  29. <taskdef name="pmd" classpath="lib/pmd-4.2.5.jar:lib/jaxen-1.1.1.jar:lib/asm-3.1.jar"
  30. classname="net.sourceforge.pmd.ant.PMDTask" />
  31. <pmd shortFilenames="true">
  32. <ruleset>checkstyle/pmd_checks.xml</ruleset>
  33. <formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
  34. <fileset dir="src/" includes="com/dmdirc/**/*.java" />
  35. <fileset dir="modules/plugins/src/" includes="com/dmdirc/**/*.java" excludes="**/commons/*.java"/>
  36. <fileset dir="modules/util/src/" includes="com/dmdirc/**/*.java"/>
  37. <fileset dir="modules/parser/src/" includes="com/dmdirc/**/*.java"/>
  38. </pmd>
  39. <xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
  40. </target>
  41. <target name="pmd-minimal" description="Run PMD with minimal ruleset.">
  42. <taskdef name="pmd" classpath="lib/pmd-4.2.5.jar:lib/jaxen-1.1.1.jar:lib/asm-3.1.jar"
  43. classname="net.sourceforge.pmd.ant.PMDTask" />
  44. <pmd shortFilenames="true">
  45. <ruleset>checkstyle/pmd_minimal.xml</ruleset>
  46. <formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
  47. <fileset dir="src/" includes="com/dmdirc/**/*.java" />
  48. <fileset dir="modules/plugins/src/" includes="com/dmdirc/**/*.java" excludes="**/commons/*.java"/>
  49. <fileset dir="modules/util/src/" includes="com/dmdirc/**/*.java"/>
  50. <fileset dir="modules/parser/src/" includes="com/dmdirc/**/*.java"/>
  51. </pmd>
  52. <xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
  53. </target>
  54. <target name="cpd" description="Run CPD.">
  55. <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" />
  56. <cpd format="xml" minimumTokenCount="50" outputFile="reports/report-cpd.xml">
  57. <fileset dir="src/com/">
  58. <include name="**/*.java"/>
  59. </fileset>
  60. </cpd>
  61. <xslt in="reports/report-cpd.xml" style="checkstyle/cpd.xslt" out="reports/report-cpd.html" />
  62. </target>
  63. <target name="findbugs" depends="jar" description="Run Findbugs.">
  64. <mkdir dir="reports/findbugs" />
  65. <taskdef name="findbugs" classpath="lib/findbugs-ant.jar" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
  66. <findbugs home="/usr/share/java/findbugs/" effort="max"
  67. jvmargs="-Xmx512M"
  68. output="xml:withMessages"
  69. outputFile="reports/findbugs/report-fb.xml" reportLevel="low">
  70. <sourcePath path="src/" />
  71. <class location="dist/DMDirc.jar" />
  72. </findbugs>
  73. <xslt in="reports/findbugs/report-fb.xml" style="checkstyle/findbugs.xslt" out="reports/report-fb.html" />
  74. </target>
  75. </project>