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

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