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 5.1KB

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