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 23 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  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. <mkdir dir="${custom-tasks-dir}"/>
  165. <javac srcdir="src/make" destdir="${custom-tasks-dir}">
  166. </javac>
  167. <taskdef name="antlib-jar" classname="org.apache.myrmidon.build.AntlibJarTask">
  168. <classpath location="${custom-tasks-dir}"/>
  169. </taskdef>
  170. </target>
  171. <!-- Compiles the source code -->
  172. <target name="compile" depends="check_for_optional_packages">
  173. <tstamp/>
  174. <mkdir dir="${build.src}"/>
  175. <copy file="${java.dir}/${constants.file}" tofile="${build.src}/${constants.file}"/>
  176. <replace file="${build.src}/${constants.file}" token="@@VERSION@@" value="${version}" />
  177. <replace file="${build.src}/${constants.file}" token="@@DATE@@" value="${TODAY}" />
  178. <property name="ant.package" value="org/apache/tools/ant"/>
  179. <property name="antlib.package" value="org/apache/antlib"/>
  180. <property name="vfs.package" value="org/apache/aut/vfs"/>
  181. <property name="optional.package" value="${ant.package}/taskdefs/optional"/>
  182. <property name="optional.type.package" value="${ant.package}/types/optional"/>
  183. <property name="util.package" value="${ant.package}/util"/>
  184. <property name="regexp.package" value="${util.package}/regexp"/>
  185. <mkdir dir="${build.classes}"/>
  186. <javac srcdir="src/main"
  187. destdir="${build.classes}"
  188. debug="${debug}"
  189. optimize="${optimize}"
  190. deprecation="${deprecation}">
  191. <classpath refid="project.class.path"/>
  192. <!--
  193. <exclude name="${constants.file}"/>
  194. <src path="${build.src}" />
  195. -->
  196. <src path="${java.dir}" />
  197. <include name="**/*.java"/>
  198. <exclude name="${regexp.package}/JakartaRegexp*.java"
  199. unless="jakarta.regexp.present" />
  200. <exclude name="${regexp.package}/JakartaOro*.java"
  201. unless="jakarta.oro.present" />
  202. <exclude name="${regexp.package}/Jdk14Regexp*.java"
  203. unless="jdk1.4+" />
  204. <exclude name="${ant.package}/AntSecurityManager.java"
  205. unless="jdk1.2+" />
  206. <exclude name="${ant.package}/listener/Log4jListener.java"
  207. unless="log4j.present" />
  208. <exclude name="${vfs.package}/provider/ftp/**" unless="netcomp.present"/>
  209. <exclude name="${vfs.package}/provider/smb/**" unless="jcifs.present"/>
  210. <exclude name="${optional.package}/IContract.java" unless="icontract.present" />
  211. <exclude name="${optional.package}/Script.java" unless="bsf.present" />
  212. <exclude name="${optional.package}/StyleBook.java" unless="stylebook.present" />
  213. <exclude name="${optional.package}/NetRexxC.java" unless="netrexx.present" />
  214. <exclude name="${antlib.package}/xml/TraXLiaison.java" unless="trax.present" />
  215. <exclude name="${antlib.package}/xml/XalanLiaison.java" unless="xalan.present" />
  216. <exclude name="${optional.package}/ejb/Ejbc*.java" unless="ejb.ejbc.present" />
  217. <exclude name="${optional.package}/ejb/DDCreator*.java" unless="ejb.DDCreator.present" />
  218. <exclude name="${optional.package}/ejb/WLRun.java" unless="ejb.wls.present" />
  219. <exclude name="${optional.package}/ejb/WLStop.java" unless="ejb.wls.present" />
  220. <exclude name="${optional.package}/ejb/EjbJar.java" unless="ejbjar.support" />
  221. <exclude name="${optional.package}/ejb/*DeploymentTool.java" unless="ejbjar.support" />
  222. <exclude name="${optional.package}/ejb/IPlanet*.java" unless="ejbjar.support" />
  223. <exclude name="${optional.package}/Javah.java" unless="jdk1.2+" />
  224. <exclude name="${optional.package}/junit/*" unless="junit.present" />
  225. <exclude name="${optional.package}/net/**.java" unless="netcomp.present" />
  226. <exclude name="${optional.package}/net/MimeMail.java" unless="javamail.complete" />
  227. <exclude name="${optional.package}/scm/AntStarTeam*.java" unless="starteam.present" />
  228. <exclude name="${optional.package}/ANTLR.java" unless="antlr.present" />
  229. <exclude name="${optional.package}/ide/VAJ*.java" unless="vaj.present" />
  230. <exclude name="${optional.package}/ide/VAJ*Servlet.java"
  231. unless="servlet.present" />
  232. <exclude name="${optional.package}/perforce/*.java" unless="jakarta.oro.present" />
  233. <exclude name="${optional.package}/sound/*.java" unless="jmf.present" />
  234. <exclude name="${optional.package}/junit/XMLResultAggregator.java"
  235. unless="trax.present" />
  236. <exclude name="${optional.package}/junit/AggregateTransformer.java"
  237. unless="trax.present" />
  238. <exclude name="${optional.package}/junit/XMLResultAggregator.java"
  239. unless="xalan2.present" />
  240. <exclude name="${optional.package}/junit/AggregateTransformer.java"
  241. unless="xalan2.present" />
  242. <exclude name="${optional.package}/junit/XalanExecutor.java"
  243. unless="xalan2.present" />
  244. <exclude name="${optional.package}/junit/Xalan2Executor.java"
  245. unless="xalan2.present" />
  246. <exclude name="${optional.package}/junit/Xalan1Executor.java"
  247. unless="xalan.present" />
  248. <exclude name="${optional.package}/jdepend/*" unless="jdepend.present" />
  249. <exclude name="${optional.package}/sitraka/**" unless="some.regexp.support"/>
  250. <exclude name="${optional.package}/metamata/MAudit*" unless="jakarta.oro.present"/>
  251. <exclude name="${optional.package}/metamata/MMetrics*"
  252. unless="trax.present"/>
  253. <exclude name="${optional.package}/metamata/**" unless="jdk1.2+" />
  254. <exclude name="${optional.package}/ManifestFile.java"
  255. unless="jdk1.2+" />
  256. <exclude name="${optional.type.package}/depend/*.java"
  257. unless="bcel.present" />
  258. <exclude name="${util.package}/depend/*.java"
  259. unless="bcel.present" />
  260. <exclude name="${optional.type.package}/depend/*.java"
  261. unless="jdk1.2+" />
  262. <exclude name="${util.package}/depend/*.java"
  263. unless="jdk1.2+" />
  264. </javac>
  265. <copy todir="${build.classes}">
  266. <fileset dir="${java.dir}">
  267. <exclude name="**/*.java"/>
  268. </fileset>
  269. </copy>
  270. </target>
  271. <!-- Creates the jars file -->
  272. <target name="jars" depends="custom-tasks, compile">
  273. <mkdir dir="${build.lib}"/>
  274. <jar jarfile="${build.lib}/myrmidon-launcher.jar"
  275. basedir="${build.classes}"
  276. manifest="${manifest.dir}/myrmidon-launcher.mf">
  277. <include name="org/apache/myrmidon/launcher/*" />
  278. </jar>
  279. <antlib-jar jarfile="${build.lib}/myrmidon-api.jar"
  280. basedir="${build.classes}"
  281. manifest="${manifest.dir}/myrmidon-api.mf"
  282. rolesDescriptor="${manifest.dir}/builtin-ant-roles.xml"
  283. descriptor="${manifest.dir}/builtin-ant-descriptor.xml"
  284. servicesDescriptor="${manifest.dir}/core-services.xml" >
  285. <include name="org/apache/myrmidon/api/*" />
  286. <include name="org/apache/myrmidon/aspects/*" />
  287. <include name="org/apache/myrmidon/converter/*" />
  288. <include name="org/apache/myrmidon/interfaces/**" />
  289. <include name="org/apache/myrmidon/listeners/*" />
  290. <include name="org/apache/myrmidon/framework/**" />
  291. <include name="org/apache/aut/**" />
  292. <include name="org/apache/tools/**" />
  293. <!-- <include name="org/apache/myrmidon/*" />
  294. <include name="org/apache/myrmidon/components/**"/>
  295. <include name="org/apache/myrmidon/frontends/*" /> -->
  296. </antlib-jar>
  297. <!--
  298. <jar jarfile="${build.lib}/myrmidon-framework.jar"
  299. basedir="${build.classes}"
  300. manifest="${manifest.dir}/myrmidon-framework.mf">
  301. <include name="org/apache/myrmidon/framework/**" />
  302. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  303. <include name="builtin-ant-roles.xml"/>
  304. </zipfileset>
  305. <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  306. <include name="builtin-ant-descriptor.xml"/>
  307. </zipfileset>
  308. </jar>
  309. -->
  310. <jar jarfile="${build.lib}/myrmidon-container.jar"
  311. basedir="${build.classes}"
  312. manifest="${manifest.dir}/myrmidon-container.mf">
  313. <include name="org/apache/myrmidon/components/**" />
  314. <include name="org/apache/myrmidon/frontends/*" />
  315. <include name="org/apache/myrmidon/*" />
  316. </jar>
  317. <ant antfile="antlib.xml">
  318. <property name="antlib.name" value="core"/>
  319. </ant>
  320. <ant antfile="antlib.xml">
  321. <property name="antlib.name" value="file"/>
  322. </ant>
  323. <ant antfile="antlib.xml">
  324. <property name="antlib.name" value="archive"/>
  325. </ant>
  326. <ant antfile="antlib.xml">
  327. <property name="antlib.name" value="cvslib"/>
  328. </ant>
  329. <ant antfile="antlib.xml">
  330. <property name="antlib.name" value="nativelib"/>
  331. </ant>
  332. <ant antfile="antlib.xml">
  333. <property name="antlib.name" value="security"/>
  334. </ant>
  335. <ant antfile="antlib.xml">
  336. <property name="antlib.name" value="runtime"/>
  337. </ant>
  338. <ant antfile="antlib.xml">
  339. <property name="antlib.name" value="sound"/>
  340. </ant>
  341. <ant antfile="antlib.xml">
  342. <property name="antlib.name" value="vfile"/>
  343. </ant>
  344. <antlib-jar jarfile="${build.lib}/selftest.atl"
  345. basedir="${build.classes}"
  346. manifest="${manifest.dir}/selftest.mf"
  347. descriptor="${manifest.dir}/selftest-ant-descriptor.xml"
  348. rolesDescriptor="${manifest.dir}/empty-roles.xml">
  349. <include name="org/apache/antlib/selftest/**" />
  350. <exclude name="org/apache/antlib/selftest/extension1/**" />
  351. </antlib-jar>
  352. <jar jarfile="${build.lib}/selftest-extension1.jar"
  353. basedir="${build.classes}"
  354. manifest="${manifest.dir}/selftest-extension1.mf">
  355. <include name="org/apache/antlib/selftest/extension1/**" />
  356. </jar>
  357. </target>
  358. <!-- Compiles and runs the unit tests -->
  359. <target name="test" depends="dist-lite" if="junit.present" description="Runs the unit tests">
  360. <!-- Compile the unit tests -->
  361. <mkdir dir="${test.classes}"/>
  362. <javac srcdir="src/testcases"
  363. destdir="${test.classes}"
  364. debug="${debug}"
  365. optimize="${optimize}"
  366. deprecation="${deprecation}">
  367. <classpath refid="project.class.path"/>
  368. </javac>
  369. <!-- Prepare test files -->
  370. <delete dir="${test.working.dir}"/>
  371. <copy todir="${test.working.dir}">
  372. <fileset dir="etc/testcases"/>
  373. </copy>
  374. <!-- Prepare a dummy installation -->
  375. <copy todir="${test.working.dir}/dist">
  376. <fileset dir="${dist.dir}"/>
  377. </copy>
  378. <!-- Prepare the VFS tests -->
  379. <property name="test.vfs.dir" location="${test.working.dir}/org/apache/aut/vfs"/>
  380. <mkdir dir="${test.vfs.dir}/write-tests"/>
  381. <mkdir dir="${test.vfs.dir}/basedir/emptydir"/>
  382. <zip zipfile="${test.vfs.dir}/test.zip">
  383. <fileset dir="${test.vfs.dir}" includes="basedir/**"/>
  384. </zip>
  385. <!-- Prepare deployer tests -->
  386. <property name="test.deployer.dir"
  387. value="${test.working.dir}/org/apache/myrmidon/components/deployer"/>
  388. <mkdir dir="${test.deployer.dir}"/>
  389. <jar jarfile="${test.deployer.dir}/test.atl">
  390. <zipfileset dir="etc/testcases/org/apache/myrmidon/components/deployer"
  391. prefix="META-INF"
  392. includes="*.xml"/>
  393. </jar>
  394. <!-- Prepare type factory tests -->
  395. <mkdir dir="${test.working.dir}/org/apache/myrmidon/interfaces/type"/>
  396. <jar jarfile="${test.working.dir}/org/apache/myrmidon/interfaces/type/types.jar">
  397. <fileset dir="${test.classes}" includes="org/apache/myrmidon/interfaces/type/MyType1.class"/>
  398. </jar>
  399. <!-- Prepare the project tests -->
  400. <copy file="src/manifest/testcases-ant-descriptor.xml" tofile="${test.classes}/META-INF/ant-descriptor.xml"/>
  401. <!-- Run all the tests -->
  402. <junit printsummary="on"
  403. fork="false">
  404. <formatter type="brief" usefile="false"/>
  405. <classpath>
  406. <fileset dir="${test.working.dir}/dist/bin/lib" includes="**/*.jar"/>
  407. <fileset dir="${test.working.dir}/dist/lib" includes="**/*.jar, **/*.atl" excludes="crimson.jar"/>
  408. </classpath>
  409. <classpath location="${test.classes}"/>
  410. <!-- Pass config to the tests -->
  411. <sysproperty key="test.basedir" value="${test.working.dir}"/>
  412. <sysproperty key="test.smb.uri" value="smb://${vfs.user}:${vfs.password}@${vfs.host}/${vfs.user}/vfs"/>
  413. <sysproperty key="test.ftp.uri" value="ftp://${vfs.user}:${vfs.password}@${vfs.host}/home/${vfs.user}/vfs"/>
  414. <batchtest>
  415. <fileset dir="${test.classes}">
  416. <include name="**/*Test.class" unless="single.test"/>
  417. <exclude name="**/Abstract*Test.class"/>
  418. <include name="**/${single.test}Test.class" if="single.test"/>
  419. <exclude name="**/BzipTest.class" unless="test.bzip"/>
  420. <exclude name="**/SmbFileSystemTest.class" unless="test.smb"/>
  421. <exclude name="**/FtpFileSystemTest.class" unless="test.ftp"/>
  422. </fileset>
  423. </batchtest>
  424. </junit>
  425. </target>
  426. <!-- Creates the distribution -->
  427. <target name="dist-lite" depends="jars">
  428. <mkdir dir="${dist.bin}"/>
  429. <mkdir dir="${dist.lib}"/>
  430. <mkdir dir="${dist.ext}"/>
  431. <copy file="${build.lib}/myrmidon-launcher.jar" tofile="${dist.bin}/myrmidon-launcher.jar" />
  432. <copy file="${build.lib}/myrmidon-container.jar" tofile="${dist.bin}/lib/myrmidon-container.jar" />
  433. <copy todir="${dist.lib}">
  434. <fileset dir="${build.lib}">
  435. <exclude name="selftest.atl"/>
  436. <exclude name="myrmidon-container.jar"/>
  437. <exclude name="myrmidon-launcher.jar"/>
  438. </fileset>
  439. </copy>
  440. <copy todir="${dist.ext}">
  441. <fileset dir="${build.lib}">
  442. <include name="selftest.atl"/>
  443. <include name="selftest-extension1.jar"/>
  444. </fileset>
  445. </copy>
  446. <copy todir="${dist.lib}">
  447. <fileset dir="${lib.dir}">
  448. <exclude name="ant.jar"/>
  449. </fileset>
  450. </copy>
  451. <copy todir="${dist.bin}">
  452. <fileset dir="${script.dir}"/>
  453. </copy>
  454. <chmod dir="${dist.dir}" perm="go-rwx" />
  455. <chmod file="${dist.bin}/ant" perm="u+x"/>
  456. <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="**/*.bat" />
  457. <fixcrlf srcdir="${dist.bin}" eol="lf" includes="**/*.sh" />
  458. <fixcrlf srcdir="${dist.bin}" eol="lf" includes="ant" />
  459. </target>
  460. <!-- Creates the distribution -->
  461. <target name="dist" depends="dist-lite,test" description="Builds the distribution"/>
  462. <!-- Cleans up build and distribution directories -->
  463. <target name="clean" description="Deletes all built files">
  464. <delete dir="${build.dir}"/>
  465. <delete dir="${dist.dir}" failonerror="false"/>
  466. <delete>
  467. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  468. </delete>
  469. </target>
  470. <!-- Cleans up the compiled classes -->
  471. <target name="clean-classes">
  472. <delete dir="${build.classes}"/>
  473. </target>
  474. <!-- Rebuilds the distribution -->
  475. <target name="rebuild" description="Rebuilds the distribution">
  476. <antcall target="clean"/>
  477. <antcall target="main"/>
  478. </target>
  479. <!-- Recompiles the classes, and builds the distribution -->
  480. <target name="recompile" description="Recompiles and builds the the distribution">
  481. <antcall target="clean-classes"/>
  482. <antcall target="main"/>
  483. </target>
  484. </project>