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 6.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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.warnings" value="true"/>
  28. <property name="build.compiler.pedantic" value="true"/>
  29. <property name="build.compiler.depend" value="true"/>
  30. <property name="build.compiler.fulldepend" value="true"/>
  31. <property name="debug" value="on"/>
  32. <property name="optimize" value="off"/>
  33. <property name="deprecation" value="on"/>
  34. <property name="build.dir" value="build"/>
  35. <property name="build.lib" value="${build.dir}/lib"/>
  36. <property name="build.src" value="${build.dir}/src"/>
  37. <property name="build.classes" value="${build.dir}/classes"/>
  38. <property name="src.base" value="src"/>
  39. <property name="manifest.dir" value="${src.base}/manifest"/>
  40. <property name="java.dir" value="${src.base}/java"/>
  41. <property name="script.dir" value="${src.base}/script"/>
  42. <property name="lib.dir" value="lib"/>
  43. <property name="dist.name" value="${Name}-${version}"/>
  44. <property name="dist.dir" value="dist"/>
  45. <property name="dist.bin" value="${dist.dir}/bin"/>
  46. <property name="dist.lib" value="${dist.dir}/lib"/>
  47. <property name="dist.ext" value="${dist.dir}/ext"/>
  48. <property name="constants.file" value="org/apache/myrmidon/Constants.java"/>
  49. <path id="project.class.path">
  50. <pathelement path="${java.class.path}" />
  51. <fileset dir="${lib.dir}">
  52. <include name="*.jar" />
  53. </fileset>
  54. <pathelement path="${build.classes}" />
  55. </path>
  56. <!-- Main target -->
  57. <target name="main" depends="dist" />
  58. <!-- Compiles the source code -->
  59. <target name="compile">
  60. <tstamp/>
  61. <mkdir dir="${build.src}"/>
  62. <copy file="${java.dir}/${constants.file}" tofile="${build.src}/${constants.file}"/>
  63. <replace file="${build.src}/${constants.file}" token="@@VERSION@@" value="${version}" />
  64. <replace file="${build.src}/${constants.file}" token="@@DATE@@" value="${TODAY}" />
  65. <mkdir dir="${build.classes}"/>
  66. <javac srcdir="${java.dir}"
  67. destdir="${build.classes}"
  68. debug="${debug}"
  69. optimize="${optimize}"
  70. deprecation="${deprecation}">
  71. <classpath refid="project.class.path"/>
  72. <exclude name="org/apache/ant/gui/**"/>
  73. <exclude name="${constants.file}"/>
  74. <src path="${build.src}" />
  75. </javac>
  76. </target>
  77. <!-- Creates the jars file -->
  78. <target name="jars" depends="compile">
  79. <mkdir dir="${build.lib}"/>
  80. <jar jarfile="${build.lib}/ant.jar"
  81. basedir="${build.classes}"
  82. manifest="${manifest.dir}/ant-manifest.mf">
  83. <include name="org/apache/myrmidon/launcher/*" />
  84. </jar>
  85. <jar jarfile="${build.lib}/myrmidon.jar"
  86. basedir="${build.classes}"
  87. manifest="${manifest.dir}/myrmidon-manifest.mf">
  88. <include name="org/apache/**" />
  89. <exclude name="org/apache/myrmidon/launcher/*" />
  90. <exclude name="org/apache/myrmidon/libs/*" />
  91. <exclude name="org/apache/ant/**" />
  92. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  93. <include name="builtin-ant-roles.xml"/>
  94. </zipfileset>
  95. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  96. <include name="builtin-ant-descriptor.xml"/>
  97. </zipfileset>
  98. </jar>
  99. <jar jarfile="${build.lib}/core.atl" basedir="${build.classes}">
  100. <include name="org/apache/ant/modules/**" />
  101. <include name="org/apache/myrmidon/libs/core/**" />
  102. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  103. <include name="core-ant-descriptor.xml"/>
  104. </zipfileset>
  105. </jar>
  106. <jar jarfile="${build.lib}/selftest.atl" basedir="${build.classes}">
  107. <include name="org/apache/myrmidon/libs/selftest/**" />
  108. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  109. <include name="selftest-ant-descriptor.xml"/>
  110. </zipfileset>
  111. </jar>
  112. <jar jarfile="${build.lib}/runtime.atl" basedir="${build.classes}">
  113. <include name="org/apache/myrmidon/libs/runtime/**"/>
  114. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  115. <include name="runtime-ant-descriptor.xml"/>
  116. </zipfileset>
  117. </jar>
  118. <jar jarfile="${build.lib}/ant1.atl" basedir="${build.classes}">
  119. <include name="org/apache/myrmidon/libs/ant1/**"/>
  120. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  121. <include name="ant1-ant-descriptor.xml"/>
  122. </zipfileset>
  123. </jar>
  124. </target>
  125. <!-- Creates the distribution -->
  126. <target name="dist" depends="jars">
  127. <mkdir dir="${dist.bin}"/>
  128. <mkdir dir="${dist.lib}"/>
  129. <mkdir dir="${dist.ext}"/>
  130. <copy file="tools/lib/ant.jar" tofile="${dist.lib}/ant1-compat.jar" />
  131. <copy todir="${dist.lib}">
  132. <fileset dir="${build.lib}">
  133. <exclude name="selftest.atl"/>
  134. </fileset>
  135. </copy>
  136. <copy todir="${dist.ext}">
  137. <fileset dir="${build.lib}">
  138. <include name="selftest.atl"/>
  139. </fileset>
  140. </copy>
  141. <copy todir="${dist.lib}">
  142. <fileset dir="${lib.dir}"/>
  143. </copy>
  144. <copy todir="${dist.bin}">
  145. <fileset dir="${script.dir}"/>
  146. </copy>
  147. <chmod dir="${dist.dir}" perm="go-rwx" />
  148. <chmod file="${dist.bin}/ant" perm="u+x"/>
  149. <fixcrlf srcdir="${dist.bin}" cr="add" includes="**/*.bat" />
  150. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="**/*.sh" />
  151. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="ant" />
  152. </target>
  153. <!-- Cleans up build and distribution directories -->
  154. <target name="clean">
  155. <delete dir="${build.dir}"/>
  156. <delete dir="${dist.dir}"/>
  157. <delete>
  158. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  159. </delete>
  160. </target>
  161. </project>