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.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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="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. </target>
  76. <!-- Creates the jars file -->
  77. <target name="jars" depends="compile">
  78. <mkdir dir="${build.lib}"/>
  79. <jar jarfile="${build.lib}/ant.jar"
  80. basedir="${build.classes}"
  81. manifest="${manifest.dir}/ant-manifest.mf">
  82. <include name="org/apache/myrmidon/launcher/*" />
  83. </jar>
  84. <jar jarfile="${build.lib}/myrmidon.jar"
  85. basedir="${build.classes}"
  86. manifest="${manifest.dir}/myrmidon-manifest.mf">
  87. <include name="org/apache/**" />
  88. <exclude name="org/apache/myrmidon/launcher/*" />
  89. <exclude name="org/apache/myrmidon/libs/*" />
  90. <exclude name="org/apache/ant/**" />
  91. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  92. <include name="builtin-ant-roles.xml"/>
  93. </zipfileset>
  94. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  95. <include name="builtin-ant-descriptor.xml"/>
  96. </zipfileset>
  97. </jar>
  98. <jar jarfile="${build.lib}/core.atl" basedir="${build.classes}">
  99. <include name="org/apache/ant/modules/**" />
  100. <include name="org/apache/myrmidon/libs/core/**" />
  101. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  102. <include name="core-ant-descriptor.xml"/>
  103. </zipfileset>
  104. </jar>
  105. <jar jarfile="${build.lib}/selftest.atl" basedir="${build.classes}">
  106. <include name="org/apache/myrmidon/libs/selftest/**" />
  107. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  108. <include name="selftest-ant-descriptor.xml"/>
  109. </zipfileset>
  110. </jar>
  111. <jar jarfile="${build.lib}/runtime.atl" basedir="${build.classes}">
  112. <include name="org/apache/myrmidon/libs/runtime/**"/>
  113. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  114. <include name="runtime-ant-descriptor.xml"/>
  115. </zipfileset>
  116. </jar>
  117. <jar jarfile="${build.lib}/ant1.atl" basedir="${build.classes}">
  118. <include name="org/apache/myrmidon/libs/ant1/**"/>
  119. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  120. <include name="ant1-ant-descriptor.xml"/>
  121. </zipfileset>
  122. </jar>
  123. </target>
  124. <!-- Creates the distribution -->
  125. <target name="dist" depends="jars">
  126. <mkdir dir="${dist.bin}"/>
  127. <mkdir dir="${dist.lib}"/>
  128. <copy file="tools/lib/ant.jar" tofile="${dist.lib}/ant1-compat.jar" />
  129. <copy todir="${dist.lib}">
  130. <fileset dir="${build.lib}"/>
  131. </copy>
  132. <copy todir="${dist.lib}">
  133. <fileset dir="${lib.dir}"/>
  134. </copy>
  135. <copy todir="${dist.bin}">
  136. <fileset dir="${script.dir}"/>
  137. </copy>
  138. <chmod dir="${dist.dir}" perm="go-rwx" />
  139. <chmod file="${dist.bin}/ant" perm="u+x"/>
  140. <fixcrlf srcdir="${dist.bin}" cr="add" includes="**/*.bat" />
  141. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="**/*.sh" />
  142. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="ant" />
  143. </target>
  144. <!-- Cleans up build and distribution directories -->
  145. <target name="clean">
  146. <delete dir="${build.dir}"/>
  147. <delete dir="${dist.dir}"/>
  148. <delete>
  149. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  150. </delete>
  151. </target>
  152. </project>