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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <?xml version="1.0"?>
  2. <!--
  3. ==============================================================================
  4. Ant build file
  5. Authors:
  6. Peter Donald <donaldp@apache.org>
  7. Legal:
  8. Copyright (c) 2000 The Apache Software Foundation. All Rights Reserved.
  9. ==============================================================================
  10. -->
  11. <project default="main" basedir=".">
  12. <!--
  13. Give user a chance to override without editing this file
  14. (and without typing -D each time he compiles it)
  15. -->
  16. <property file=".ant.properties"/>
  17. <property file="${user.home}/.ant.properties"/>
  18. <property name="name" value="ant"/>
  19. <property name="Name" value="Ant"/>
  20. <property name="version" value="0.01-myrmidon"/>
  21. <property name="year" value="2000"/>
  22. <!--
  23. these are here only for those who use jikes compiler. For other
  24. developers this part makes no difference.
  25. -->
  26. <property name="build.compiler.emacs" value="on"/>
  27. <property name="build.compiler.pedantic" value="true"/>
  28. <property name="build.compiler.depend" value="true"/>
  29. <property name="build.compiler.fulldepend" value="true"/>
  30. <property name="debug" value="on"/>
  31. <property name="optimize" value="off"/>
  32. <property name="deprecation" value="on"/>
  33. <property name="build.dir" value="build"/>
  34. <property name="build.lib" value="${build.dir}/lib"/>
  35. <property name="build.src" value="${build.dir}/src"/>
  36. <property name="build.classes" value="${build.dir}/classes"/>
  37. <property name="src.base" value="src"/>
  38. <property name="manifest.dir" value="${src.base}/manifest"/>
  39. <property name="java.dir" value="${src.base}/java"/>
  40. <property name="script.dir" value="${src.base}/script"/>
  41. <property name="lib.dir" value="lib"/>
  42. <property name="dist.name" value="${Name}-${version}"/>
  43. <property name="dist.dir" value="dist"/>
  44. <property name="dist.bin" value="${dist.dir}/bin"/>
  45. <property name="dist.lib" value="${dist.dir}/lib"/>
  46. <property name="dist.ext" value="${dist.dir}/ext"/>
  47. <property name="constants.file" value="org/apache/myrmidon/Constants.java"/>
  48. <path id="project.class.path">
  49. <pathelement path="${java.class.path}" />
  50. <fileset dir="${lib.dir}">
  51. <include name="*.jar" />
  52. </fileset>
  53. <pathelement path="${build.classes}" />
  54. </path>
  55. <!-- Main target -->
  56. <target name="main" depends="dist" />
  57. <!-- Compiles the source code -->
  58. <target name="compile">
  59. <tstamp/>
  60. <mkdir dir="${build.src}"/>
  61. <copy file="${java.dir}/${constants.file}" tofile="${build.src}/${constants.file}"/>
  62. <replace file="${build.src}/${constants.file}" token="@@VERSION@@" value="${version}" />
  63. <replace file="${build.src}/${constants.file}" token="@@DATE@@" value="${TODAY}" />
  64. <mkdir dir="${build.classes}"/>
  65. <javac srcdir="${java.dir}"
  66. destdir="${build.classes}"
  67. debug="${debug}"
  68. optimize="${optimize}"
  69. deprecation="${deprecation}">
  70. <classpath refid="project.class.path"/>
  71. <exclude name="org/apache/ant/gui/**"/>
  72. <exclude name="${constants.file}"/>
  73. <src path="${build.src}" />
  74. </javac>
  75. <copy todir="${build.classes}">
  76. <fileset dir="${java.dir}">
  77. <include name="**/*.properties"/>
  78. </fileset>
  79. </copy>
  80. </target>
  81. <!-- Creates the jars file -->
  82. <target name="jars" depends="compile">
  83. <mkdir dir="${build.lib}"/>
  84. <jar jarfile="${build.lib}/myrmidon-launcher.jar"
  85. basedir="${build.classes}"
  86. manifest="${manifest.dir}/myrmidon-launcher.mf">
  87. <include name="org/apache/myrmidon/launcher/*" />
  88. </jar>
  89. <jar jarfile="${build.lib}/myrmidon-api.jar"
  90. basedir="${build.classes}"
  91. manifest="${manifest.dir}/myrmidon-api.mf">
  92. <include name="org/apache/myrmidon/api/*" />
  93. <include name="org/apache/myrmidon/aspects/*" />
  94. <include name="org/apache/myrmidon/converter/*" />
  95. <include name="org/apache/myrmidon/interfaces/**" />
  96. <include name="org/apache/myrmidon/listeners/*" />
  97. <include name="org/apache/myrmidon/framework/**" />
  98. <!-- <include name="org/apache/myrmidon/*" />
  99. <include name="org/apache/myrmidon/components/**"/>
  100. <include name="org/apache/myrmidon/frontends/*" /> -->
  101. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  102. <include name="builtin-ant-roles.xml"/>
  103. </zipfileset>
  104. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  105. <include name="builtin-ant-descriptor.xml"/>
  106. </zipfileset>
  107. </jar>
  108. <!--
  109. <jar jarfile="${build.lib}/myrmidon-framework.jar"
  110. basedir="${build.classes}"
  111. manifest="${manifest.dir}/myrmidon-framework.mf">
  112. <include name="org/apache/myrmidon/framework/**" />
  113. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  114. <include name="builtin-ant-roles.xml"/>
  115. </zipfileset>
  116. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  117. <include name="builtin-ant-descriptor.xml"/>
  118. </zipfileset>
  119. </jar>
  120. -->
  121. <jar jarfile="${build.lib}/myrmidon-container.jar"
  122. basedir="${build.classes}"
  123. manifest="${manifest.dir}/myrmidon-container.mf">
  124. <include name="org/apache/myrmidon/components/**" />
  125. <include name="org/apache/myrmidon/frontends/*" />
  126. <include name="org/apache/myrmidon/*" />
  127. </jar>
  128. <jar jarfile="${build.lib}/core.atl" basedir="${build.classes}">
  129. <include name="org/apache/ant/modules/**" />
  130. <include name="org/apache/myrmidon/libs/core/**" />
  131. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  132. <include name="core-ant-descriptor.xml"/>
  133. </zipfileset>
  134. </jar>
  135. <jar jarfile="${build.lib}/selftest.atl"
  136. basedir="${build.classes}"
  137. manifest="${manifest.dir}/selftest.mf">
  138. <include name="org/apache/myrmidon/libs/selftest/**" />
  139. <exclude name="org/apache/myrmidon/libs/selftest/extension1/**" />
  140. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  141. <include name="selftest-ant-descriptor.xml"/>
  142. </zipfileset>
  143. </jar>
  144. <jar jarfile="${build.lib}/selftest-extension1.jar"
  145. basedir="${build.classes}"
  146. manifest="${manifest.dir}/selftest-extension1.mf">
  147. <include name="org/apache/myrmidon/libs/selftest/extension1/**" />
  148. </jar>
  149. <jar jarfile="${build.lib}/runtime.atl" basedir="${build.classes}">
  150. <include name="org/apache/myrmidon/libs/runtime/**"/>
  151. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  152. <include name="runtime-ant-descriptor.xml"/>
  153. </zipfileset>
  154. </jar>
  155. <jar jarfile="${build.lib}/ant1.atl" basedir="${build.classes}">
  156. <include name="org/apache/myrmidon/libs/ant1/**"/>
  157. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  158. <include name="ant1-ant-descriptor.xml"/>
  159. </zipfileset>
  160. </jar>
  161. </target>
  162. <!-- Creates the distribution -->
  163. <target name="dist" depends="jars">
  164. <mkdir dir="${dist.bin}"/>
  165. <mkdir dir="${dist.lib}"/>
  166. <mkdir dir="${dist.ext}"/>
  167. <copy file="tools/lib/ant.jar" tofile="${dist.lib}/ant1-compat.jar" />
  168. <copy file="${build.lib}/myrmidon-launcher.jar" tofile="${dist.bin}/myrmidon-launcher.jar" />
  169. <copy file="${build.lib}/myrmidon-container.jar" tofile="${dist.bin}/lib/myrmidon-container.jar" />
  170. <copy todir="${dist.lib}">
  171. <fileset dir="${build.lib}">
  172. <exclude name="selftest.atl"/>
  173. <exclude name="myrmidon-container.jar"/>
  174. <exclude name="myrmidon-launcher.jar"/>
  175. </fileset>
  176. </copy>
  177. <copy todir="${dist.ext}">
  178. <fileset dir="${build.lib}">
  179. <include name="selftest.atl"/>
  180. <include name="selftest-extension1.jar"/>
  181. </fileset>
  182. </copy>
  183. <copy todir="${dist.lib}">
  184. <fileset dir="${lib.dir}"/>
  185. </copy>
  186. <copy todir="${dist.bin}">
  187. <fileset dir="${script.dir}"/>
  188. </copy>
  189. <chmod dir="${dist.dir}" perm="go-rwx" />
  190. <chmod file="${dist.bin}/ant" perm="u+x"/>
  191. <fixcrlf srcdir="${dist.bin}" cr="add" includes="**/*.bat" />
  192. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="**/*.sh" />
  193. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="ant" />
  194. </target>
  195. <!-- Cleans up build and distribution directories -->
  196. <target name="clean">
  197. <delete dir="${build.dir}"/>
  198. <delete dir="${dist.dir}"/>
  199. <delete>
  200. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  201. </delete>
  202. </target>
  203. </project>