You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 8.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <project default="main" name="Mutant">
  2. <property name="src.dir" value="src"/>
  3. <property name="lib.dir" value="lib"/>
  4. <property name="java.dir" value="${src.dir}/java"/>
  5. <property name="bin.dir" value="bin"/>
  6. <property name="dist.dir" value="dist"/>
  7. <property name="javadocs.dir" value="${dist.dir}/javadocs"/>
  8. <property name="distlib.dir" value="${dist.dir}/lib"/>
  9. <property name="debug" value="true"/>
  10. <path id="classpath.parser">
  11. <fileset dir="${lib.dir}/parser" includes="*.jar"/>
  12. </path>
  13. <path id="classpath.common">
  14. <pathelement location="${distlib.dir}/init.jar"/>
  15. </path>
  16. <path id="classpath.antcore">
  17. <path refid="classpath.common"/>
  18. <pathelement location="${distlib.dir}/common/common.jar"/>
  19. <path refid="classpath.parser"/>
  20. </path>
  21. <path id="classpath.frontend">
  22. <path refid="classpath.antcore"/>
  23. <pathelement location="${distlib.dir}/antcore/antcore.jar"/>
  24. </path>
  25. <path id="classpath.start">
  26. <pathelement location="${distlib.dir}/init.jar"/>
  27. </path>
  28. <target name="buildsetup">
  29. <available classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"
  30. property="checkstyle.available"/>
  31. <mkdir dir="${bin.dir}"/>
  32. <mkdir dir="${distlib.dir}"/>
  33. <copy todir="${distlib.dir}/parser">
  34. <fileset dir="${lib.dir}/parser"/>
  35. </copy>
  36. </target>
  37. <target name="init" depends="buildsetup">
  38. <mkdir dir="${bin.dir}/init"/>
  39. <depend destdir="${bin.dir}/init" srcdir="${java.dir}/init"/>
  40. <javac destdir="${bin.dir}/init" srcdir="${java.dir}/init" debug="${debug}"/>
  41. <jar basedir="${bin.dir}/init" jarfile="${distlib.dir}/init.jar"/>
  42. </target>
  43. <target name="common" depends="init">
  44. <mkdir dir="${bin.dir}/common"/>
  45. <mkdir dir="${distlib.dir}/common"/>
  46. <depend destdir="${bin.dir}/common" srcdir="${java.dir}/common">
  47. <classpath refid="classpath.common"/>
  48. </depend>
  49. <javac destdir="${bin.dir}/common" srcdir="${java.dir}/common" debug="${debug}">
  50. <classpath refid="classpath.common"/>
  51. </javac>
  52. <jar basedir="${bin.dir}/common" jarfile="${distlib.dir}/common/common.jar"/>
  53. </target>
  54. <target name="antcore" depends="common">
  55. <mkdir dir="${bin.dir}/antcore"/>
  56. <mkdir dir="${distlib.dir}/antcore"/>
  57. <depend destdir="${bin.dir}/antcore" srcdir="${java.dir}/antcore">
  58. <classpath refid="classpath.antcore"/>
  59. </depend>
  60. <javac destdir="${bin.dir}/antcore" srcdir="${java.dir}/antcore" debug="${debug}">
  61. <classpath refid="classpath.antcore"/>
  62. </javac>
  63. <jar basedir="${bin.dir}/antcore" jarfile="${distlib.dir}/antcore/antcore.jar"/>
  64. </target>
  65. <target name="frontend" depends="antcore, start">
  66. <mkdir dir="${bin.dir}/frontend"/>
  67. <mkdir dir="${distlib.dir}/frontend"/>
  68. <depend destdir="${bin.dir}/frontend" srcdir="${java.dir}/frontend">
  69. <classpath refid="classpath.frontend"/>
  70. </depend>
  71. <javac destdir="${bin.dir}/frontend" srcdir="${java.dir}/frontend" debug="${debug}">
  72. <classpath refid="classpath.frontend"/>
  73. </javac>
  74. <jar basedir="${bin.dir}/frontend" jarfile="${distlib.dir}/frontend/frontend.jar">
  75. <include name="**/frontend/*.class"/>
  76. </jar>
  77. <jar basedir="${bin.dir}/frontend" jarfile="${distlib.dir}/frontend/cli.jar">
  78. <include name="**/cli/*.class"/>
  79. <manifest>
  80. <attribute name="Main-Class" value="org.apache.ant.cli.Commandline"/>
  81. <attribute name="Class-Path" value="frontend.jar"/>
  82. </manifest>
  83. </jar>
  84. </target>
  85. <target name="start" depends="init">
  86. <mkdir dir="${bin.dir}/start"/>
  87. <depend destdir="${bin.dir}/start" srcdir="${java.dir}/start">
  88. <classpath refid="classpath.start"/>
  89. </depend>
  90. <javac destdir="${bin.dir}/start" srcdir="${java.dir}/start" debug="${debug}">
  91. <classpath refid="classpath.start"/>
  92. </javac>
  93. <jar basedir="${bin.dir}/start" jarfile="${distlib.dir}/start.jar">
  94. <manifest>
  95. <attribute name="Main-Class" value="org.apache.ant.start.Main"/>
  96. <attribute name="Class-Path" value="init.jar"/>
  97. </manifest>
  98. <include name="org/apache/ant/**/*"/>
  99. </jar>
  100. <jar basedir="${bin.dir}/start" jarfile="${distlib.dir}/ant.jar">
  101. <manifest>
  102. <attribute name="Main-Class" value="org.apache.tools.ant.Main"/>
  103. <attribute name="Class-Path" value="start.jar"/>
  104. </manifest>
  105. <include name="org/apache/tools/ant/**/*"/>
  106. </jar>
  107. </target>
  108. <target name="ant1compat" depends="common">
  109. <ant antfile="build/ant1compat.xml" />
  110. </target>
  111. <target name="remote" depends="init">
  112. <mkdir dir="${bin.dir}/remote"/>
  113. <depend destdir="${bin.dir}/remote" srcdir="${java.dir}/remote">
  114. <classpath refid="classpath.start"/>
  115. </depend>
  116. <javac destdir="${bin.dir}/remote" srcdir="${java.dir}/remote" debug="${debug}">
  117. <classpath refid="classpath.start"/>
  118. </javac>
  119. <jar basedir="${bin.dir}/remote" jarfile="${distlib.dir}/remote.jar">
  120. <manifest>
  121. <attribute name="Main-Class" value="org.apache.ant.remote.RemoteMain"/>
  122. </manifest>
  123. </jar>
  124. </target>
  125. <target name="clean">
  126. <delete dir="${bin.dir}"/>
  127. <delete dir="${dist.dir}"/>
  128. </target>
  129. <target name="antlibs" depends="common">
  130. <antcall target="build-lib" inheritall="false">
  131. <param name="libset" value="system"/>
  132. </antcall>
  133. <ant antfile="build/script.xml" inheritAll="false"/>
  134. </target>
  135. <target name="build-lib">
  136. <mkdir dir="${bin.dir}/antlibs/${libset}"/>
  137. <mkdir dir="${distlib.dir}/antlibs"/>
  138. <path id="classpath.antlibs">
  139. <path refid="classpath.common"/>
  140. <pathelement location="${distlib.dir}/common/common.jar"/>
  141. </path>
  142. <depend destdir="${bin.dir}/antlibs/${libset}" srcdir="${java.dir}/antlibs/${libset}">
  143. <classpath refid="classpath.antlibs"/>
  144. </depend>
  145. <javac destdir="${bin.dir}/antlibs/${libset}" srcdir="${java.dir}/antlibs/${libset}" debug="${debug}">
  146. <classpath refid="classpath.antlibs"/>
  147. </javac>
  148. <jar basedir="${bin.dir}/antlibs/${libset}" jarfile="${distlib.dir}/antlibs/${libset}.jar">
  149. <metainf dir="${java.dir}/antlibs/${libset}"
  150. includes="antlib.xml"/>
  151. </jar>
  152. </target>
  153. <target name="main" depends="frontend, antlibs, ant1compat, remote, checkstyle"/>
  154. <target name="checkstyle" if="checkstyle.available">
  155. <taskdef name="checkstyle"
  156. classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/>
  157. <mkdir dir="${bin.dir}/check"/>
  158. <checkstyle headerFile="../../src/etc/RequiredHeader.txt"
  159. headerIgnoreLine="4">
  160. <fileset dir="${java.dir}">
  161. <include name="**/*.java"/>
  162. <exclude name="**/org/apache/tools/ant/Task.java"/>
  163. <exclude name="**/org/apache/tools/ant/ProjectComponent.java"/>
  164. <exclude name="**/org/apache/tools/ant/types/DataType.java"/>
  165. <exclude name="**/builder/MutantBuilder.java"/>
  166. <exclude name="**/builder/Ant1CompatBuilder.java"/>
  167. </fileset>
  168. </checkstyle>
  169. <checkstyle allowProtected="true"
  170. headerFile="../../src/etc/RequiredHeader.txt"
  171. headerIgnoreLine="4">
  172. <fileset dir="${java.dir}">
  173. <include name="**/org/apache/tools/ant/Task.java"/>
  174. <include name="**/org/apache/tools/ant/ProjectComponent.java"/>
  175. <include name="**/org/apache/tools/ant/types/DataType.java"/>
  176. </fileset>
  177. </checkstyle>
  178. </target>
  179. <target name="javadocs">
  180. <mkdir dir="${javadocs.dir}"/>
  181. <javadoc packagenames="org.apache.*"
  182. useexternalfile="yes"
  183. sourcepath="${java.dir}/antcore:${java.dir}/init:${java.dir}/common:${java.dir}/frontend:${java.dir}/start"
  184. destdir="${javadocs.dir}"
  185. author="true"
  186. private ="true"
  187. version="true"
  188. windowtitle="Mutant API"
  189. doctitle="Mutant">
  190. <group title="Ant Library" packages="org.apache.ant.common.antlib*" />
  191. <group title="Services" packages="org.apache.ant.common.service*" />
  192. <group title="Common Facilities" packages="org.apache.ant.common*" />
  193. <group title="Core" packages="org.apache.ant.antcore*" />
  194. <group title="Initialisation" packages="org.apache.ant.init*,org.apache.ant.start*" />
  195. <group title="Command Line" packages="org.apache.ant.cli*" />
  196. <group title="Ant1 Compatability Layer" packages="org.apache.tools.ant*" />
  197. <tag name="created" description="Date Created:" scope="types"/>
  198. </javadoc>
  199. </target>
  200. </project>