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.8KB

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