Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

build.xml 8.4KB

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