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.xml 6.7KB

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