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

Replaced usage of Avalon Context with Myrmidon specific Context: * Moved read-only property and resolve methods from TaskContext to new Context interface. TaskContext now extends the new Context interface. * Changed the Configurer methods to use the new Context. Both implementations use the supplied Context to do property resolution. * Renamed TaskContext.getPropertys() -> getProperties(). * Moved PropertyUtil from configurer to workspace package, as that is now the only place it is used. * Changed PropertyUtil to work with the new Context. RoleManager: * A default implementation for a role can now be specified. Currently can only do this programatically. DefaultMasterConverter: * Removed MasterConverter interface. It is now identified by the Converter role. * Now caches the converter instances. * Changed the converter search algorithm to traverse the *source* class hierarchy, including all interfaces. Chooses the most specialised conversion, and fails if there is more than one such choice. DefaultConfigurer: * Attempts to convert references, if the type does not match the expected type. * Changed handling of nested elements, for named adders/setters: * If the method type can be mapped to a role, and that role has a default implementation, then use that default implementation. * Otherwise, if the method type is an interface, fail. * Otherwise, create an instance using no-args constructor. * Changed handling of nested elements, for typed adders/setters: * If the method type can be mapped to a role, and the element name is a type of that role, then use that role to create the instance. * Otherwise, use the type factory for the generic data-type role. * Attempt to convert the instance if it is not of the expected type. * Added a bunch of test cases for new functionality. * Renamed all the ConfigTest classes to have descriptive names. Misc: * Renamed package framework.factorys -> framework.factories. * Made tests work when fork = false. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271539 13f79535-47bb-0310-9956-ffa450edef68
24 years ago
Replaced usage of Avalon Context with Myrmidon specific Context: * Moved read-only property and resolve methods from TaskContext to new Context interface. TaskContext now extends the new Context interface. * Changed the Configurer methods to use the new Context. Both implementations use the supplied Context to do property resolution. * Renamed TaskContext.getPropertys() -> getProperties(). * Moved PropertyUtil from configurer to workspace package, as that is now the only place it is used. * Changed PropertyUtil to work with the new Context. RoleManager: * A default implementation for a role can now be specified. Currently can only do this programatically. DefaultMasterConverter: * Removed MasterConverter interface. It is now identified by the Converter role. * Now caches the converter instances. * Changed the converter search algorithm to traverse the *source* class hierarchy, including all interfaces. Chooses the most specialised conversion, and fails if there is more than one such choice. DefaultConfigurer: * Attempts to convert references, if the type does not match the expected type. * Changed handling of nested elements, for named adders/setters: * If the method type can be mapped to a role, and that role has a default implementation, then use that default implementation. * Otherwise, if the method type is an interface, fail. * Otherwise, create an instance using no-args constructor. * Changed handling of nested elements, for typed adders/setters: * If the method type can be mapped to a role, and the element name is a type of that role, then use that role to create the instance. * Otherwise, use the type factory for the generic data-type role. * Attempt to convert the instance if it is not of the expected type. * Added a bunch of test cases for new functionality. * Renamed all the ConfigTest classes to have descriptive names. Misc: * Renamed package framework.factorys -> framework.factories. * Made tests work when fork = false. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271539 13f79535-47bb-0310-9956-ffa450edef68
24 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. <?xml version="1.0"?>
  2. <!--
  3. ==============================================================================
  4. Ant build file
  5. Authors:
  6. Peter Donald <peter@apache.org>
  7. Legal:
  8. Copyright (c) 2000 The Apache Software Foundation. All Rights Reserved.
  9. ==============================================================================
  10. -->
  11. <project name="myrmidon" 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="myrmidon"/>
  19. <property name="Name" value="Myrmidon"/>
  20. <property name="version" value="0.01"/>
  21. <property name="year" value="2000-2001"/>
  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" value="jikes"/>
  27. <property name="build.compiler.emacs" value="on"/>
  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="gen.dir" value="${build.dir}/gen"/>
  49. <property name="test.dir" value="${build.dir}/test"/>
  50. <property name="test.working.dir" value="${test.dir}/testcases"/>
  51. <property name="test.classes" value="${test.dir}/classes"/>
  52. <property name="constants.file" value="org/apache/myrmidon/Constants.java"/>
  53. <path id="project.class.path">
  54. <pathelement path="${java.class.path}" />
  55. <fileset dir="${lib.dir}">
  56. <include name="*.jar" />
  57. </fileset>
  58. <pathelement path="${build.classes}" />
  59. </path>
  60. <!-- Main target -->
  61. <target name="main" depends="dist-lite" description="Builds the distribution"/>
  62. <!-- lets see what is available -->
  63. <target name="check_for_optional_packages">
  64. <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
  65. <available property="jdk1.3+" classname="java.lang.StrictMath" />
  66. <available property="jdk1.4+" classname="java.lang.CharSequence" />
  67. <available property="bsf.present"
  68. classname="com.ibm.bsf.BSFManager"
  69. classpathref="project.class.path" />
  70. <available property="netrexx.present"
  71. classname="netrexx.lang.Rexx"
  72. classpathref="project.class.path" />
  73. <available property="trax.present"
  74. classname="javax.xml.transform.Transformer"
  75. classpathref="project.class.path" />
  76. <available property="xslp.present"
  77. classname="com.kvisco.xsl.XSLProcessor"
  78. classpathref="project.class.path" />
  79. <available property="xalan.present"
  80. classname="org.apache.xalan.xslt.XSLTProcessorFactory"
  81. classpathref="project.class.path" />
  82. <available property="xalan2.present"
  83. classname="org.apache.xalan.transformer.TransformerImpl"
  84. classpathref="project.class.path" />
  85. <available property="ejb.ejbc.present"
  86. classname="weblogic.ejbc"
  87. classpathref="project.class.path" />
  88. <available property="ejb.DDCreator.present"
  89. classname="weblogic.ejb.utils.DDCreator"
  90. classpathref="project.class.path" />
  91. <available property="ejb.wls.present"
  92. classname="weblogic.Server"
  93. classpathref="project.class.path" />
  94. <available property="junit.present"
  95. classname="junit.framework.TestCase"
  96. classpathref="project.class.path" />
  97. <available property="netcomp.present"
  98. classname="com.oroinc.net.ftp.FTPClient"
  99. classpathref="project.class.path" />
  100. <available property="jcifs.present"
  101. classname="jcifs.smb.SmbFile"
  102. classpathref="project.class.path" />
  103. <available property="starteam.present"
  104. classname="com.starbase.util.Platform"
  105. classpathref="project.class.path" />
  106. <available property="antlr.present"
  107. classname="antlr.Tool"
  108. classpathref="project.class.path"/>
  109. <available property="vaj.present"
  110. classname="com.ibm.ivj.util.base.Workspace"
  111. classpathref="project.class.path"/>
  112. <available property="stylebook.present"
  113. classname="org.apache.stylebook.Engine"
  114. classpathref="project.class.path"/>
  115. <available property="jakarta.regexp.present"
  116. classname="org.apache.regexp.RE"
  117. classpathref="project.class.path"/>
  118. <available property="jakarta.oro.present"
  119. classname="org.apache.oro.text.regex.Perl5Matcher"
  120. classpathref="project.class.path" />
  121. <available property="jmf.present"
  122. classname="javax.sound.sampled.Clip"
  123. classpathref="project.class.path"/>
  124. <available property="icontract.present"
  125. classname="com.reliablesystems.iContract.IContracted"
  126. classpathref="project.class.path"/>
  127. <available property="jdepend.present"
  128. classname="jdepend.framework.JDepend"
  129. classpathref="project.class.path"/>
  130. <available property="log4j.present"
  131. classname="org.apache.log4j.Category"
  132. classpathref="project.class.path"/>
  133. <!-- this is just a way to check for a TraX implementation -->
  134. <available property="trax.impl.present"
  135. resource="META-INF/services/javax.xml.transform.TransformerFactory"
  136. classpathref="project.class.path"/>
  137. <available property="xalan.envcheck"
  138. classname="org.apache.xalan.xslt.EnvironmentCheck"
  139. classpathref="project.class.path" />
  140. <available property="servlet.present"
  141. classname="javax.servlet.Servlet"
  142. classpathref="project.class.path"/>
  143. <available property="adaptx.present"
  144. classname="org.exolab.adaptx.xslt.XSLTProcessor"
  145. classpathref="project.class.path" />
  146. <available property="xerces.present"
  147. classname="org.apache.xerces.parsers.SAXParser"
  148. classpathref="project.class.path" />
  149. <available property="bcel.present"
  150. classname="org.apache.bcel.Constants"
  151. classpathref="project.class.path" />
  152. <condition property="javamail.complete">
  153. <and>
  154. <available classname="javax.activation.DataHandler"
  155. classpathref="project.class.path"/>
  156. <available classname="javax.mail.Transport"
  157. classpathref="project.class.path"/>
  158. </and>
  159. </condition>
  160. </target>
  161. <!-- Compiles and installs the custom build tasks -->
  162. <target name="custom-tasks">
  163. <property name="custom-tasks-dir" value="${build.dir}/tasks"/>
  164. <property name="custom-package-dir" value="${custom-tasks-dir}/org/apache/myrmidon/build"/>
  165. <mkdir dir="${custom-tasks-dir}"/>
  166. <javac srcdir="src/make" destdir="${custom-tasks-dir}">
  167. <classpath refid="project.class.path"/>
  168. </javac>
  169. <copy file="${manifest.dir}/ant-descriptor.template" tofile="${custom-package-dir}/ant-descriptor.j"/>
  170. <copy file="${manifest.dir}/ant-roles.template" tofile="${custom-package-dir}/ant-roles.j"/>
  171. <copy file="${manifest.dir}/type.j" tofile="${custom-package-dir}/type.j"/>
  172. <taskdef name="antlib-jar" classname="org.apache.myrmidon.build.AntlibJarTask">
  173. <classpath location="${custom-tasks-dir}"/>
  174. </taskdef>
  175. <taskdef name="antlib-descriptor" classname="org.apache.myrmidon.build.AntlibDescriptorTask">
  176. <classpath>
  177. <pathelement location="${custom-tasks-dir}"/>
  178. <path refid="project.class.path"/>
  179. </classpath>
  180. </taskdef>
  181. </target>
  182. <!-- Compiles the source code -->
  183. <target name="compile" depends="check_for_optional_packages">
  184. <tstamp/>
  185. <mkdir dir="${build.src}"/>
  186. <copy file="${java.dir}/${constants.file}" tofile="${build.src}/${constants.file}"/>
  187. <replace file="${build.src}/${constants.file}" token="@@VERSION@@" value="${version}" />
  188. <replace file="${build.src}/${constants.file}" token="@@DATE@@" value="${TODAY}" />
  189. <property name="ant.package" value="org/apache/tools/ant"/>
  190. <property name="antlib.package" value="org/apache/antlib"/>
  191. <property name="vfs.package" value="org/apache/aut/vfs"/>
  192. <property name="optional.package" value="${ant.package}/taskdefs/optional"/>
  193. <property name="optional.type.package" value="${ant.package}/types/optional"/>
  194. <property name="util.package" value="${ant.package}/util"/>
  195. <property name="regexp.package" value="${util.package}/regexp"/>
  196. <mkdir dir="${build.classes}"/>
  197. <javac srcdir="src/main"
  198. destdir="${build.classes}"
  199. debug="${debug}"
  200. optimize="${optimize}"
  201. deprecation="${deprecation}">
  202. <classpath refid="project.class.path"/>
  203. <!--
  204. <exclude name="${constants.file}"/>
  205. <src path="${build.src}" />
  206. -->
  207. <src path="${java.dir}" />
  208. <include name="**/*.java"/>
  209. <exclude name="${regexp.package}/JakartaRegexp*.java"
  210. unless="jakarta.regexp.present" />
  211. <exclude name="${regexp.package}/JakartaOro*.java"
  212. unless="jakarta.oro.present" />
  213. <exclude name="${regexp.package}/Jdk14Regexp*.java"
  214. unless="jdk1.4+" />
  215. <exclude name="${ant.package}/AntSecurityManager.java"
  216. unless="jdk1.2+" />
  217. <exclude name="${ant.package}/listener/Log4jListener.java"
  218. unless="log4j.present" />
  219. <exclude name="${vfs.package}/provider/ftp/**" unless="netcomp.present"/>
  220. <exclude name="${vfs.package}/provider/smb/**" unless="jcifs.present"/>
  221. <exclude name="${optional.package}/IContract.java" unless="icontract.present" />
  222. <exclude name="${optional.package}/Script.java" unless="bsf.present" />
  223. <exclude name="${optional.package}/StyleBook.java" unless="stylebook.present" />
  224. <exclude name="${optional.package}/NetRexxC.java" unless="netrexx.present" />
  225. <exclude name="${antlib.package}/xml/TraXLiaison.java" unless="trax.present" />
  226. <exclude name="${antlib.package}/xml/XalanLiaison.java" unless="xalan.present" />
  227. <exclude name="${optional.package}/ejb/Ejbc*.java" unless="ejb.ejbc.present" />
  228. <exclude name="${optional.package}/ejb/DDCreator*.java" unless="ejb.DDCreator.present" />
  229. <exclude name="${optional.package}/ejb/WLRun.java" unless="ejb.wls.present" />
  230. <exclude name="${optional.package}/ejb/WLStop.java" unless="ejb.wls.present" />
  231. <exclude name="${optional.package}/ejb/EjbJar.java" unless="ejbjar.support" />
  232. <exclude name="${optional.package}/ejb/*DeploymentTool.java" unless="ejbjar.support" />
  233. <exclude name="${optional.package}/ejb/IPlanet*.java" unless="ejbjar.support" />
  234. <exclude name="${optional.package}/Javah.java" unless="jdk1.2+" />
  235. <exclude name="${optional.package}/junit/*" unless="junit.present" />
  236. <exclude name="${optional.package}/net/**.java" unless="netcomp.present" />
  237. <exclude name="${optional.package}/net/MimeMail.java" unless="javamail.complete" />
  238. <exclude name="${optional.package}/scm/AntStarTeam*.java" unless="starteam.present" />
  239. <exclude name="${optional.package}/ANTLR.java" unless="antlr.present" />
  240. <exclude name="${optional.package}/ide/VAJ*.java" unless="vaj.present" />
  241. <exclude name="${optional.package}/ide/VAJ*Servlet.java"
  242. unless="servlet.present" />
  243. <exclude name="${optional.package}/perforce/*.java" unless="jakarta.oro.present" />
  244. <exclude name="${optional.package}/sound/*.java" unless="jmf.present" />
  245. <exclude name="${optional.package}/junit/XMLResultAggregator.java"
  246. unless="trax.present" />
  247. <exclude name="${optional.package}/junit/AggregateTransformer.java"
  248. unless="trax.present" />
  249. <exclude name="${optional.package}/junit/XMLResultAggregator.java"
  250. unless="xalan2.present" />
  251. <exclude name="${optional.package}/junit/AggregateTransformer.java"
  252. unless="xalan2.present" />
  253. <exclude name="${optional.package}/junit/XalanExecutor.java"
  254. unless="xalan2.present" />
  255. <exclude name="${optional.package}/junit/Xalan2Executor.java"
  256. unless="xalan2.present" />
  257. <exclude name="${optional.package}/junit/Xalan1Executor.java"
  258. unless="xalan.present" />
  259. <exclude name="${optional.package}/jdepend/*" unless="jdepend.present" />
  260. <exclude name="${optional.package}/sitraka/**" unless="some.regexp.support"/>
  261. <exclude name="${optional.package}/metamata/MAudit*" unless="jakarta.oro.present"/>
  262. <exclude name="${optional.package}/metamata/MMetrics*"
  263. unless="trax.present"/>
  264. <exclude name="${optional.package}/metamata/**" unless="jdk1.2+" />
  265. <exclude name="${optional.package}/ManifestFile.java"
  266. unless="jdk1.2+" />
  267. <exclude name="${optional.type.package}/depend/*.java"
  268. unless="bcel.present" />
  269. <exclude name="${util.package}/depend/*.java"
  270. unless="bcel.present" />
  271. <exclude name="${optional.type.package}/depend/*.java"
  272. unless="jdk1.2+" />
  273. <exclude name="${util.package}/depend/*.java"
  274. unless="jdk1.2+" />
  275. </javac>
  276. <copy todir="${build.classes}">
  277. <fileset dir="${java.dir}">
  278. <exclude name="**/*.java"/>
  279. </fileset>
  280. </copy>
  281. </target>
  282. <target name="jar-prepare" depends="custom-tasks, compile">
  283. <mkdir dir="${build.lib}"/>
  284. <!-- Define the packaging for the various jars -->
  285. <patternset id="myrmidon-launcher.include">
  286. <include name="org/apache/myrmidon/launcher/*" />
  287. </patternset>
  288. <patternset id="myrmidon-api-xdoclet.include">
  289. <include name="org/apache/myrmidon/api/*" />
  290. <include name="org/apache/myrmidon/aspects/*" />
  291. <include name="org/apache/myrmidon/interfaces/**" />
  292. <include name="org/apache/myrmidon/listeners/*" />
  293. <include name="org/apache/myrmidon/framework/**" />
  294. <include name="org/apache/aut/converter/**" />
  295. </patternset>
  296. <patternset id="myrmidon-api.include">
  297. <include name="org/apache/myrmidon/api/*" />
  298. <include name="org/apache/myrmidon/aspects/*" />
  299. <include name="org/apache/myrmidon/converter/*" />
  300. <include name="org/apache/myrmidon/interfaces/**" />
  301. <include name="org/apache/myrmidon/listeners/*" />
  302. <include name="org/apache/myrmidon/framework/**" />
  303. <include name="org/apache/aut/**" />
  304. <include name="org/apache/tools/**" />
  305. </patternset>
  306. <patternset id="myrmidon-container.include">
  307. <include name="org/apache/myrmidon/components/**" />
  308. <include name="org/apache/myrmidon/frontends/*" />
  309. <include name="org/apache/myrmidon/*" />
  310. </patternset>
  311. <patternset id="selftest.include">
  312. <include name="org/apache/antlib/selftest/**" />
  313. <exclude name="org/apache/antlib/selftest/extension1/**" />
  314. </patternset>
  315. <patternset id="selftest-extension1.include">
  316. <include name="org/apache/antlib/selftest/extension1/**" />
  317. </patternset>
  318. </target>
  319. <!-- The generation of the descriptor is kept separated from the packaging
  320. of the jars, since jarring is fast and XDoclet is pretty slow.-->
  321. <target name="antlib-descriptors"
  322. depends="jar-prepare"
  323. unless="antlib-descriptors.omit"
  324. description="Generates Antlib descriptors using XDoclet.">
  325. <!-- The "builtin" descriptors include metainfo for both
  326. myrmidon-api and myrmidon-container jars.
  327. (Packaged with myrmidon-api.jar). -->
  328. <antlib-descriptor libName="builtin"
  329. destdir="${gen.dir}"
  330. classpathref="project.class.path">
  331. <fileset dir="${java.dir}">
  332. <patternset refid="myrmidon-api-xdoclet.include"/>
  333. <!-- <patternset refid="myrmidon-container.include"/>-->
  334. </fileset>
  335. </antlib-descriptor>
  336. <antlib-descriptor libName="selftest"
  337. destdir="${gen.dir}"
  338. classpathref="project.class.path">
  339. <fileset dir="${java.dir}">
  340. <patternset refid="selftest.include"/>
  341. </fileset>
  342. </antlib-descriptor>
  343. </target>
  344. <target name="test-xdocs" depends="antlib-descriptors" description="Generate documentation for antlibs">
  345. <!-- start to test xdocs generation -->
  346. <ant antfile="antlib.xml" target="antlib-docs">
  347. <property name="antlib.name" value="core"/>
  348. </ant>
  349. </target>
  350. <!-- Package the jar files -->
  351. <target name="jars" depends="antlib-descriptors">
  352. <jar jarfile="${build.lib}/myrmidon-launcher.jar"
  353. basedir="${build.classes}"
  354. manifest="${manifest.dir}/myrmidon-launcher.mf">
  355. <patternset refid="myrmidon-launcher.include"/>
  356. </jar>
  357. <jar jarfile="${build.lib}/myrmidon-container.jar"
  358. basedir="${build.classes}"
  359. manifest="${manifest.dir}/myrmidon-container.mf">
  360. <patternset refid="myrmidon-container.include"/>
  361. </jar>
  362. <antlib-jar jarfile="${build.lib}/myrmidon-api.jar"
  363. basedir="${build.classes}"
  364. manifest="${manifest.dir}/myrmidon-api.mf"
  365. rolesDescriptor="${gen.dir}/builtin-ant-roles.xml"
  366. descriptor="${gen.dir}/builtin-ant-descriptor.xml"
  367. servicesDescriptor="${manifest.dir}/core-services.xml" >
  368. <patternset refid="myrmidon-api.include"/>
  369. </antlib-jar>
  370. <antlib-jar jarfile="${build.lib}/selftest.atl"
  371. basedir="${build.classes}"
  372. manifest="${manifest.dir}/selftest.mf"
  373. descriptor="${gen.dir}/selftest-ant-descriptor.xml"
  374. rolesDescriptor="${gen.dir}/selftest-ant-roles.xml">
  375. <patternset refid="selftest.include"/>
  376. </antlib-jar>
  377. <jar jarfile="${build.lib}/selftest-extension1.jar"
  378. basedir="${build.classes}"
  379. manifest="${manifest.dir}/selftest-extension1.mf">
  380. <patternset refid="selftest-extension1.include" />
  381. </jar>
  382. <!-- Simple cases handled by antlib.xml -->
  383. <ant antfile="antlib.xml">
  384. <property name="antlib.name" value="core"/>
  385. </ant>
  386. <ant antfile="antlib.xml">
  387. <property name="antlib.name" value="file"/>
  388. </ant>
  389. <ant antfile="antlib.xml">
  390. <property name="antlib.name" value="archive"/>
  391. </ant>
  392. <ant antfile="antlib.xml">
  393. <property name="antlib.name" value="cvslib"/>
  394. </ant>
  395. <ant antfile="antlib.xml">
  396. <property name="antlib.name" value="nativelib"/>
  397. </ant>
  398. <ant antfile="antlib.xml">
  399. <property name="antlib.name" value="security"/>
  400. </ant>
  401. <ant antfile="antlib.xml">
  402. <property name="antlib.name" value="runtime"/>
  403. </ant>
  404. <ant antfile="antlib.xml">
  405. <property name="antlib.name" value="sound"/>
  406. </ant>
  407. <ant antfile="antlib.xml">
  408. <property name="antlib.name" value="vfile"/>
  409. </ant>
  410. </target>
  411. <!-- Compiles and runs the unit tests -->
  412. <target name="test" depends="dist-lite" if="junit.present" description="Runs the unit tests">
  413. <!-- Compile the unit tests -->
  414. <mkdir dir="${test.classes}"/>
  415. <javac srcdir="src/testcases"
  416. destdir="${test.classes}"
  417. debug="${debug}"
  418. optimize="${optimize}"
  419. deprecation="${deprecation}">
  420. <classpath refid="project.class.path"/>
  421. </javac>
  422. <!-- Prepare test files -->
  423. <delete dir="${test.working.dir}"/>
  424. <copy todir="${test.working.dir}">
  425. <fileset dir="etc/testcases"/>
  426. </copy>
  427. <!-- Prepare a dummy installation -->
  428. <copy todir="${test.working.dir}/dist">
  429. <fileset dir="${dist.dir}"/>
  430. </copy>
  431. <!-- Prepare the VFS tests -->
  432. <property name="test.vfs.dir" location="${test.working.dir}/org/apache/aut/vfs"/>
  433. <mkdir dir="${test.vfs.dir}/write-tests"/>
  434. <mkdir dir="${test.vfs.dir}/basedir/emptydir"/>
  435. <zip zipfile="${test.vfs.dir}/test.zip">
  436. <fileset dir="${test.vfs.dir}" includes="basedir/**"/>
  437. </zip>
  438. <!-- Prepare deployer tests -->
  439. <property name="test.deployer.dir"
  440. value="${test.working.dir}/org/apache/myrmidon/components/deployer"/>
  441. <mkdir dir="${test.deployer.dir}"/>
  442. <jar jarfile="${test.deployer.dir}/test.atl">
  443. <zipfileset dir="etc/testcases/org/apache/myrmidon/components/deployer"
  444. prefix="META-INF"
  445. includes="*.xml"/>
  446. </jar>
  447. <!-- Prepare type factory tests -->
  448. <mkdir dir="${test.working.dir}/org/apache/myrmidon/interfaces/type"/>
  449. <jar jarfile="${test.working.dir}/org/apache/myrmidon/interfaces/type/types.jar">
  450. <fileset dir="${test.classes}" includes="org/apache/myrmidon/interfaces/type/MyType1.class"/>
  451. </jar>
  452. <!-- Prepare the project tests -->
  453. <copy file="src/manifest/testcases-ant-descriptor.xml" tofile="${test.classes}/META-INF/ant-descriptor.xml"/>
  454. <!-- Run all the tests -->
  455. <junit printsummary="on"
  456. fork="false">
  457. <formatter type="brief" usefile="false"/>
  458. <classpath>
  459. <fileset dir="${test.working.dir}/dist/bin/lib" includes="**/*.jar"/>
  460. <fileset dir="${test.working.dir}/dist/lib" includes="**/*.jar, **/*.atl" excludes="crimson.jar"/>
  461. </classpath>
  462. <classpath location="${test.classes}"/>
  463. <!-- Pass config to the tests -->
  464. <sysproperty key="test.basedir" value="${test.working.dir}"/>
  465. <sysproperty key="test.smb.uri" value="smb://${vfs.user}:${vfs.password}@${vfs.host}/${vfs.user}/vfs"/>
  466. <sysproperty key="test.ftp.uri" value="ftp://${vfs.user}:${vfs.password}@${vfs.host}/home/${vfs.user}/vfs"/>
  467. <batchtest>
  468. <fileset dir="${test.classes}">
  469. <include name="**/*Test.class" unless="single.test"/>
  470. <exclude name="**/Abstract*Test.class"/>
  471. <include name="**/${single.test}Test.class" if="single.test"/>
  472. <exclude name="**/BzipTest.class" unless="test.bzip"/>
  473. <exclude name="**/SmbFileSystemTest.class" unless="test.smb"/>
  474. <exclude name="**/FtpFileSystemTest.class" unless="test.ftp"/>
  475. </fileset>
  476. </batchtest>
  477. </junit>
  478. </target>
  479. <!-- Creates the distribution -->
  480. <target name="dist-lite"
  481. depends="jars"
  482. description="Generates a minimal working distribution.">
  483. <mkdir dir="${dist.bin}"/>
  484. <mkdir dir="${dist.lib}"/>
  485. <mkdir dir="${dist.ext}"/>
  486. <copy file="${build.lib}/myrmidon-launcher.jar" tofile="${dist.bin}/myrmidon-launcher.jar" />
  487. <copy file="${build.lib}/myrmidon-container.jar" tofile="${dist.bin}/lib/myrmidon-container.jar" />
  488. <copy todir="${dist.lib}">
  489. <fileset dir="${build.lib}">
  490. <exclude name="selftest.atl"/>
  491. <exclude name="myrmidon-container.jar"/>
  492. <exclude name="myrmidon-launcher.jar"/>
  493. </fileset>
  494. </copy>
  495. <copy todir="${dist.ext}">
  496. <fileset dir="${build.lib}">
  497. <include name="selftest.atl"/>
  498. <include name="selftest-extension1.jar"/>
  499. </fileset>
  500. </copy>
  501. <copy todir="${dist.lib}">
  502. <fileset dir="${lib.dir}">
  503. <exclude name="ant.jar"/>
  504. </fileset>
  505. </copy>
  506. <copy todir="${dist.bin}">
  507. <fileset dir="${script.dir}"/>
  508. </copy>
  509. <chmod dir="${dist.dir}" perm="go-rwx" />
  510. <chmod file="${dist.bin}/ant" perm="u+x"/>
  511. <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="**/*.bat" />
  512. <fixcrlf srcdir="${dist.bin}" eol="lf" includes="**/*.sh" />
  513. <fixcrlf srcdir="${dist.bin}" eol="lf" includes="ant" />
  514. </target>
  515. <target name="dist-extralite"
  516. description="A faster version of dist-lite (no XDoclet).">
  517. <property name="antlib-descriptors.omit" value="true"/>
  518. <antcall target="dist-lite"/>
  519. </target>
  520. <!-- Creates the distribution -->
  521. <target name="dist" depends="dist-lite,test" description="Builds the distribution"/>
  522. <!-- Cleans up build and distribution directories -->
  523. <target name="clean" description="Deletes all built files">
  524. <delete dir="${build.dir}"/>
  525. <delete dir="${dist.dir}" failonerror="false"/>
  526. <delete>
  527. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  528. </delete>
  529. </target>
  530. <!-- Cleans up the compiled classes -->
  531. <target name="clean-classes">
  532. <delete dir="${build.classes}"/>
  533. </target>
  534. <!-- Rebuilds the distribution -->
  535. <target name="rebuild" description="Rebuilds the distribution">
  536. <antcall target="clean"/>
  537. <antcall target="main"/>
  538. </target>
  539. <!-- Recompiles the classes, and builds the distribution -->
  540. <target name="recompile" description="Recompiles and builds the the distribution">
  541. <antcall target="clean-classes"/>
  542. <antcall target="main"/>
  543. </target>
  544. </project>