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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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, checkstyle-actions,
  9. checkstyle-core,
  10. checkstyle-commandparser,
  11. checkstyle-config, checkstyle-logger,
  12. checkstyle-parser, checkstyle-plugins,
  13. checkstyle-ui, -remove-xml-files,
  14. -move-index"
  15. description="Run checkstyle." />
  16. <target name="-allreports" depends="findbugs, cpd, pmd, checkstyle" />
  17. <target name="-mostreports" depends="cpd, pmd, checkstyle" />
  18. <target name="checkstyle-plugins">
  19. <taskdef resource="checkstyletask.properties"
  20. classpath="checkstyle-all-4.3.jar"/>
  21. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  22. failOnViolation="false">
  23. <fileset dir="src/com/dmdirc/plugins/" includes="**/*.java"/>
  24. <formatter type="xml" tofile="reports/report-plugins.xml"/>
  25. </checkstyle>
  26. <xslt in="reports/report-plugins.xml" out="reports/report-plugins.html" style="checkstyle/checkstyle.xsl"/>
  27. </target>
  28. <target name="checkstyle-actions">
  29. <taskdef resource="checkstyletask.properties"
  30. classpath="checkstyle.jar"/>
  31. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  32. failOnViolation="false">
  33. <fileset dir="src/com/dmdirc/actions/" includes="**/*.java"/>
  34. <formatter type="xml" tofile="reports/report-actions.xml"/>
  35. </checkstyle>
  36. <xslt in="reports/report-actions.xml" out="reports/report-actions.html" style="checkstyle/checkstyle.xsl"/>
  37. </target>
  38. <target name="checkstyle-ui">
  39. <taskdef resource="checkstyletask.properties"
  40. classpath="checkstyle.jar"/>
  41. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  42. failOnViolation="false">
  43. <fileset dir="src/com/dmdirc/ui/" includes="**/*.java"/>
  44. <formatter type="xml" tofile="reports/report-ui.xml"/>
  45. </checkstyle>
  46. <xslt in="reports/report-ui.xml" out="reports/report-ui.html" style="checkstyle/checkstyle.xsl"/>
  47. </target>
  48. <target name="checkstyle-parser">
  49. <taskdef resource="checkstyletask.properties"
  50. classpath="checkstyle.jar"/>
  51. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  52. failOnViolation="false">
  53. <fileset dir="src/com/dmdirc/parser/" includes="**/*.java"/>
  54. <formatter type="xml" tofile="reports/report-parser.xml"/>
  55. </checkstyle>
  56. <xslt in="reports/report-parser.xml" out="reports/report-parser.html" style="checkstyle/checkstyle.xsl"/>
  57. </target>
  58. <target name="checkstyle-logger">
  59. <taskdef resource="checkstyletask.properties"
  60. classpath="checkstyle.jar"/>
  61. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  62. failOnViolation="false">
  63. <fileset dir="src/com/dmdirc/logger/" includes="**/*.java"/>
  64. <formatter type="xml" tofile="reports/report-logger.xml"/>
  65. </checkstyle>
  66. <xslt in="reports/report-logger.xml" out="reports/report-logger.html" style="checkstyle/checkstyle.xsl"/>
  67. </target>
  68. <target name="checkstyle-config">
  69. <taskdef resource="checkstyletask.properties"
  70. classpath="checkstyle.jar"/>
  71. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  72. failOnViolation="false">
  73. <fileset dir="src/com/dmdirc/config/" includes="**/*.java"/>
  74. <formatter type="xml" tofile="reports/report-config.xml"/>
  75. </checkstyle>
  76. <xslt in="reports/report-config.xml" out="reports/report-config.html" style="checkstyle/checkstyle.xsl"/>
  77. </target>
  78. <target name="checkstyle-commandparser">
  79. <taskdef resource="checkstyletask.properties"
  80. classpath="checkstyle.jar"/>
  81. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  82. failOnViolation="false">
  83. <fileset dir="src/com/dmdirc/commandparser/" includes="**/*.java"/>
  84. <formatter type="xml" tofile="reports/report-commandparser.xml"/>
  85. </checkstyle>
  86. <xslt in="reports/report-commandparser.xml" out="reports/report-commandparser.html" style="checkstyle/checkstyle.xsl"/>
  87. </target>
  88. <target name="checkstyle-core">
  89. <taskdef resource="checkstyletask.properties"
  90. classpath="checkstyle.jar"/>
  91. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  92. failOnViolation="false">
  93. <fileset dir="src/com/dmdirc/" includes="*.java"/>
  94. <formatter type="xml" tofile="reports/report-core.xml"/>
  95. </checkstyle>
  96. <xslt in="reports/report-core.xml" out="reports/report-core.html" style="checkstyle/checkstyle.xsl"/>
  97. </target>
  98. <target name="checkstyle-all">
  99. <taskdef resource="checkstyletask.properties"
  100. classpath="checkstyle.jar"/>
  101. <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
  102. failOnViolation="false">
  103. <fileset dir="src/com/dmdirc/" includes="**/*.java"/>
  104. <formatter type="xml" tofile="reports/report-all.xml"/>
  105. </checkstyle>
  106. <xslt in="reports/report-all.xml" out="reports/report-all.html" style="checkstyle/checkstyle.xsl"/>
  107. </target>
  108. <target name="-remove-xml-files">
  109. <delete>
  110. <fileset dir="reports/" includes="*.xml"/>
  111. </delete>
  112. </target>
  113. <target name="-move-index">
  114. <!-- <copy file="checkstyle/index.html" tofile="reports/index.html"/> -->
  115. <copy file="checkstyle/sorttable.js" tofile="reports/sorttable.js"/>
  116. </target>
  117. <target name="pmd" description="Run PMD.">
  118. <taskdef name="pmd" classpath="pmd-3.9.jar"
  119. classname="net.sourceforge.pmd.ant.PMDTask" />
  120. <pmd shortFilenames="true">
  121. <ruleset>checkstyle/pmd_checks.xml</ruleset>
  122. <formatter type="xml" toFile="reports/report-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/"/>
  123. <fileset dir="src/com/" includes="**/*.java" />
  124. </pmd>
  125. <xslt in="reports/report-pmd.xml" style="checkstyle/pmd.xslt" out="reports/report-pmd.html" />
  126. </target>
  127. <target name="cpd" description="Run CPD.">
  128. <taskdef name="cpd" classpath="pmd-3.9.jar" classname="net.sourceforge.pmd.cpd.CPDTask" />
  129. <cpd format="xml" minimumTokenCount="50" outputFile="reports/report-cpd.xml">
  130. <fileset dir="src/com/">
  131. <include name="**/*.java"/>
  132. </fileset>
  133. </cpd>
  134. <xslt in="reports/report-cpd.xml" style="checkstyle/cpd.xslt" out="reports/report-cpd.html" />
  135. </target>
  136. <target name="findbugs" depends="jar" description="Run Findbugs.">
  137. <mkdir dir="reports/findbugs" />
  138. <taskdef name="findbugs" classpath="findbugs-ant.jar"
  139. classname="edu.umd.cs.findbugs.anttask.FindBugsTask" />
  140. <findbugs home="/usr/share/java/findbugs/" effort="max"
  141. jvmargs="-Xmx512M"
  142. output="xml:withMessages"
  143. outputFile="reports/findbugs/report-fb.xml" reportLevel="low">
  144. <sourcePath path="src/" />
  145. <class location="dist/DMDirc.jar" />
  146. </findbugs>
  147. <xslt in="reports/findbugs/report-fb.xml" style="checkstyle/findbugs.xslt" out="reports/report-fb.html" />
  148. </target>
  149. </project>