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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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/ant/**" />
  90. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  91. <include name="base-ant-roles.xml"/>
  92. </zipfileset>
  93. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-types.xml">
  94. <include name="base-ant-types.xml"/>
  95. </zipfileset>
  96. </jar>
  97. <jar jarfile="${build.lib}/core.tsk" basedir="${build.classes}">
  98. <include name="org/apache/ant/modules/**" />
  99. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-types.xml">
  100. <include name="core-ant-types.xml"/>
  101. </zipfileset>
  102. </jar>
  103. </target>
  104. <!-- Creates the distribution -->
  105. <target name="dist" depends="jars">
  106. <mkdir dir="${dist.bin}"/>
  107. <mkdir dir="${dist.lib}"/>
  108. <copy todir="${dist.lib}">
  109. <fileset dir="${build.lib}"/>
  110. </copy>
  111. <copy todir="${dist.lib}">
  112. <fileset dir="${lib.dir}">
  113. <exclude name="xalan*" />
  114. <exclude name="StyleBook*" />
  115. </fileset>
  116. </copy>
  117. <copy todir="${dist.bin}">
  118. <fileset dir="${script.dir}"/>
  119. </copy>
  120. <chmod dir="${dist.dir}" perm="go-rwx" />
  121. <chmod file="${dist.bin}/ant" perm="u+x"/>
  122. <fixcrlf srcdir="${dist.bin}" cr="add" includes="**/*.bat" />
  123. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="**/*.sh" />
  124. <fixcrlf srcdir="${dist.bin}" cr="remove" includes="ant" />
  125. </target>
  126. <!-- Cleans up build and distribution directories -->
  127. <target name="clean">
  128. <delete dir="${build.dir}"/>
  129. <delete dir="${dist.dir}"/>
  130. <delete>
  131. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  132. </delete>
  133. </target>
  134. </project>