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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. <?xml version="1.0"?>
  2. <!--
  3. =======================================================================
  4. Apache Ant own build file
  5. Copyright (c) 2000-2002 The Apache Software Foundation. All rights
  6. reserved.
  7. =======================================================================
  8. -->
  9. <project default="main" basedir=".">
  10. <!-- Give user a chance to override without editing this file
  11. (and without typing -D each time it compiles it) -->
  12. <property file=".ant.properties" />
  13. <property file="${user.home}/.ant.properties" />
  14. <property name="Name" value="Apache Ant"/>
  15. <property name="name" value="ant"/>
  16. <property name="version" value="1.5alpha"/>
  17. <property name="debug" value="true" />
  18. <property name="chmod.fail" value="true" />
  19. <property name="deprecation" value="false" />
  20. <property name="optimize" value="true" />
  21. <property name="junit.fork" value="false" />
  22. <property name="junit.filtertrace" value="off"/>
  23. <property name="junit.summary" value="no"/>
  24. <!--
  25. ===================================================================
  26. Set the properties related to the source tree
  27. ===================================================================
  28. -->
  29. <property name="src.dir" value="src"/>
  30. <property name="java.dir" value="${src.dir}/main"/>
  31. <property name="script.dir" value="${src.dir}/script"/>
  32. <property name="lib.dir" value="lib"/>
  33. <property name="docs.dir" value="docs"/>
  34. <property name="etc.dir" value="src/etc"/>
  35. <property name="tests.dir" value="src/testcases"/>
  36. <property name="tests.etc.dir" value="src/etc/testcases"/>
  37. <property name="ant.package" value="org/apache/tools/ant"/>
  38. <property name="optional.package" value="${ant.package}/taskdefs/optional"/>
  39. <property name="optional.type.package" value="${ant.package}/types/optional"/>
  40. <property name="util.package" value="${ant.package}/util"/>
  41. <property name="regexp.package" value="${util.package}/regexp"/>
  42. <property name="manifest" value="src/etc/manifest"/>
  43. <!--
  44. ===================================================================
  45. Set the properties for the build area
  46. ===================================================================
  47. -->
  48. <property name="build.dir" value="build"/>
  49. <property name="bootstrap.dir" value="bootstrap"/>
  50. <property name="build.classes" value="${build.dir}/classes"/>
  51. <property name="build.lib" value="${build.dir}/lib"/>
  52. <property name="build.javadocs" value="${build.dir}/javadocs"/>
  53. <property name="build.tests" value="${build.dir}/testcases"/>
  54. <path id="classpath">
  55. </path>
  56. <!-- empty for JDK 1.2+, contains classes.zip otherwise -->
  57. <path id="classes.zip">
  58. <fileset dir="${java.home}" includes="lib/classes.zip" />
  59. </path>
  60. <path id="tests-classpath">
  61. <pathelement location="${build.classes}" />
  62. <pathelement location="${build.tests}" />
  63. <!--
  64. include the test source and test data dirs
  65. so that we can pick resources via getResource(AsStream)
  66. -->
  67. <pathelement location="${tests.dir}"/>
  68. <pathelement location="${tests.etc.dir}"/>
  69. <path refid="classpath" />
  70. </path>
  71. <!-- turn this path into a string which is passed to the tests -->
  72. <property name="tests-classpath.value"
  73. refid="tests-classpath"/>
  74. <!--
  75. ===================================================================
  76. Set up properties for the distribution area
  77. ===================================================================
  78. -->
  79. <property name="dist.name" value="jakarta-${name}-${version}"/>
  80. <property name="dist.base" value="distribution"/>
  81. <property name="dist.dir" value="dist"/>
  82. <property name="dist.bin" value="${dist.dir}/bin"/>
  83. <property name="dist.lib" value="${dist.dir}/lib"/>
  84. <property name="dist.docs" value="${dist.dir}/docs"/>
  85. <property name="dist.etc" value="${dist.dir}/etc"/>
  86. <property name="dist.javadocs" value="${dist.dir}/docs/manual/api"/>
  87. <property name="src.dist.dir" value="dist-src"/>
  88. <property name="src.dist.src" value="${src.dist.dir}/src"/>
  89. <property name="src.dist.docs" value="${src.dist.dir}/docs"/>
  90. <property name="src.dist.lib" value="${src.dist.dir}/lib"/>
  91. <!--
  92. ===================================================================
  93. Set up patternsets to be used by javac and junit to exclude
  94. files that have dependencies that are not available
  95. ===================================================================
  96. -->
  97. <!-- depends on JDK version -->
  98. <patternset id="needs.jdk1.2+">
  99. <exclude name="${util.package}/optional/NoExitSecurityManager.java"
  100. unless="jdk1.2+" />
  101. <exclude name="${optional.package}/Javah.java"
  102. unless="jdk1.2+" />
  103. <exclude name="${optional.package}/metamata/*.java"
  104. unless="jdk1.2+" />
  105. <exclude name="${optional.type.package}/depend/*.java"
  106. unless="jdk1.2+" />
  107. <exclude name="${util.package}/depend/*.java"
  108. unless="jdk1.2+" />
  109. <exclude name="${optional.package}/ejb/EjbJar.java"
  110. unless="jdk1.2+" />
  111. <exclude name="${optional.package}/ejb/*DeploymentTool.java"
  112. unless="jdk1.2+" />
  113. <exclude name="${optional.package}/ejb/IPlanet*.java"
  114. unless="jdk1.2+" />
  115. <!-- uses the context classloader -->
  116. <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  117. unless="jdk1.2+" />
  118. </patternset>
  119. <patternset id="needs.jdk1.3+">
  120. <exclude name="${ant.package}/taskdefs/TestProcess.java"
  121. unless="jdk1.3+" />
  122. </patternset>
  123. <patternset id="needs.jdk1.4+">
  124. <exclude name="${regexp.package}/Jdk14Regexp*.java"
  125. unless="jdk1.4+" />
  126. </patternset>
  127. <!-- classes that should be present in Sun based JVMs, but not in
  128. Kaffe for example -->
  129. <patternset id="needs.sun.tools">
  130. <exclude name="${optional.package}/Native2Ascii.java"
  131. unless="sun.tools.present" />
  132. <exclude name="${optional.package}/Javah.java"
  133. unless="sun.tools.present" />
  134. </patternset>
  135. <patternset id="needs.sun.uue">
  136. <exclude name="${ant.package}/taskdefs/email/UUMailer.java"
  137. unless="sunuue.present" />
  138. </patternset>
  139. <patternset id="needs.sun.b64">
  140. <exclude name="${ant.package}/taskdefs/Get.java"
  141. unless="base64.present" />
  142. <exclude name="${optional.package}/splash/SplashTask.java"
  143. unless="base64.present" />
  144. </patternset>
  145. <!-- depends on external libraries -->
  146. <patternset id="needs.trax">
  147. <exclude name="${optional.package}/TraXLiaison*.java"
  148. unless="trax.present" />
  149. <exclude name="${optional.package}/junit/XMLResultAggregator.java"
  150. unless="trax.present" />
  151. <exclude name="${optional.package}/junit/AggregateTransformer.java"
  152. unless="trax.present" />
  153. <exclude name="${optional.package}/sitraka/**"
  154. unless="trax.present"/>
  155. <exclude name="${optional.package}/metamata/MMetrics*"
  156. unless="trax.present"/>
  157. </patternset>
  158. <patternset id="needs.xalan1">
  159. <exclude name="${optional.package}/XalanLiaison*.java"
  160. unless="xalan.present" />
  161. <exclude name="${optional.package}/junit/Xalan1Executor.java"
  162. unless="xalan.present" />
  163. </patternset>
  164. <patternset id="needs.xalan2">
  165. <exclude name="${optional.package}/junit/XMLResultAggregator.java"
  166. unless="xalan2.present" />
  167. <exclude name="${optional.package}/junit/AggregateTransformer.java"
  168. unless="xalan2.present" />
  169. <exclude name="${optional.package}/junit/XalanExecutor.java"
  170. unless="xalan2.present" />
  171. <exclude name="${optional.package}/junit/Xalan2Executor.java"
  172. unless="xalan2.present" />
  173. </patternset>
  174. <patternset id="needs.xslp">
  175. <exclude name="${optional.package}/XslpLiaison*.java"
  176. unless="xslp.present" />
  177. </patternset>
  178. <patternset id="needs.junit">
  179. <exclude name="${optional.package}/junit/*.java" unless="junit.present" />
  180. </patternset>
  181. <patternset id="needs.jakarta.regexp">
  182. <exclude name="${regexp.package}/JakartaRegexp*.java"
  183. unless="jakarta.regexp.present" />
  184. </patternset>
  185. <patternset id="needs.jakarta.oro">
  186. <exclude name="${regexp.package}/JakartaOro*.java"
  187. unless="jakarta.oro.present" />
  188. <exclude name="${optional.package}/perforce/*.java"
  189. unless="jakarta.oro.present" />
  190. <exclude name="${optional.package}/metamata/MAudit*.java"
  191. unless="jakarta.oro.present"/>
  192. </patternset>
  193. <patternset id="needs.jakarta.bcel">
  194. <exclude name="${ant.package}/filters/util/JavaClassHelper.java"
  195. unless="bcel.present" />
  196. <exclude name="${util.package}/depend/bcel/*.java"
  197. unless="bcel.present" />
  198. </patternset>
  199. <patternset id="needs.jakarta.log4j">
  200. <exclude name="${ant.package}/listener/Log4jListener.java"
  201. unless="log4j.present" />
  202. </patternset>
  203. <patternset id="needs.bsf">
  204. <exclude name="${optional.package}/Script.java"
  205. unless="bsf.present" />
  206. </patternset>
  207. <patternset id="needs.stylebook">
  208. <exclude name="${optional.package}/StyleBook.java"
  209. unless="stylebook.present" />
  210. </patternset>
  211. <patternset id="needs.javamail">
  212. <exclude name="${ant.package}/taskdefs/email/MimeMailer.java"
  213. unless="javamail.complete" />
  214. </patternset>
  215. <patternset id="needs.icontract">
  216. <exclude name="${optional.package}/IContract.java"
  217. unless="icontract.present" />
  218. </patternset>
  219. <patternset id="needs.netrexx">
  220. <exclude name="${optional.package}/NetRexxC.java"
  221. unless="netrexx.present" />
  222. </patternset>
  223. <patternset id="needs.weblogic.ejbc">
  224. <exclude name="${optional.package}/ejb/Ejbc*.java"
  225. unless="ejb.ejbc.present" />
  226. </patternset>
  227. <patternset id="needs.weblogic.ddcreator">
  228. <exclude name="${optional.package}/ejb/DDCreator*.java"
  229. unless="ejb.DDCreator.present" />
  230. </patternset>
  231. <patternset id="needs.weblogic.server">
  232. <exclude name="${optional.package}/ejb/WLRun.java"
  233. unless="ejb.wls.present" />
  234. <exclude name="${optional.package}/ejb/WLStop.java"
  235. unless="ejb.wls.present" />
  236. </patternset>
  237. <patternset id="needs.netcomponents">
  238. <exclude name="${optional.package}/net/FTP.java"
  239. unless="netcomp.present" />
  240. <exclude name="${optional.package}/net/TelnetTask.java"
  241. unless="netcomp.present" />
  242. </patternset>
  243. <patternset id="needs.starteam">
  244. <exclude name="${optional.package}/scm/AntStarTeam*.java"
  245. unless="starteam.present" />
  246. <exclude name="${optional.package}/starteam/*.java"
  247. unless="starteam.present" />
  248. </patternset>
  249. <patternset id="needs.vaj">
  250. <exclude name="${optional.package}/ide/VAJ*.java"
  251. unless="vaj.present" />
  252. </patternset>
  253. <patternset id="needs.antlr">
  254. <exclude name="${optional.package}/ANTLR*.java" unless="antlr.present" />
  255. </patternset>
  256. <patternset id="needs.servletapi">
  257. <exclude name="${optional.package}/ide/VAJ*Servlet.java"
  258. unless="servlet.present" />
  259. </patternset>
  260. <patternset id="needs.jmf">
  261. <exclude name="${optional.package}/sound/*.java" unless="jmf.present" />
  262. </patternset>
  263. <patternset id="needs.jdepend">
  264. <exclude name="${optional.package}/jdepend/*" unless="jdepend.present" />
  265. </patternset>
  266. <patternset id="onlinetests">
  267. <exclude name="**/GetTest.java" if="offline" />
  268. </patternset>
  269. <patternset id="needs.swing">
  270. <exclude name="${optional.package}/splash/*.java" unless="swing.present" />
  271. </patternset>
  272. <!--
  273. ===================================================================
  274. Check to see what optional dependencies are available
  275. ===================================================================
  276. -->
  277. <target name="check_for_optional_packages">
  278. <available property="jdk1.2+" classname="java.lang.ThreadLocal" />
  279. <available property="jdk1.3+" classname="java.lang.StrictMath" />
  280. <available property="jdk1.4+" classname="java.lang.CharSequence" />
  281. <available property="bsf.present"
  282. classname="com.ibm.bsf.BSFManager"
  283. classpathref="classpath" />
  284. <available property="netrexx.present"
  285. classname="netrexx.lang.Rexx"
  286. classpathref="classpath" />
  287. <available property="trax.present"
  288. classname="javax.xml.transform.Transformer"
  289. classpathref="classpath" />
  290. <available property="xslp.present"
  291. classname="com.kvisco.xsl.XSLProcessor"
  292. classpathref="classpath" />
  293. <available property="xalan.present"
  294. classname="org.apache.xalan.xslt.XSLTProcessorFactory"
  295. classpathref="classpath" />
  296. <available property="xalan2.present"
  297. classname="org.apache.xalan.transformer.TransformerImpl"
  298. classpathref="classpath" />
  299. <available property="ejb.ejbc.present"
  300. classname="weblogic.ejbc"
  301. classpathref="classpath" />
  302. <available property="ejb.DDCreator.present"
  303. classname="weblogic.ejb.utils.DDCreator"
  304. classpathref="classpath" />
  305. <available property="ejb.wls.present"
  306. classname="weblogic.Server"
  307. classpathref="classpath" />
  308. <available property="junit.present"
  309. classname="junit.framework.TestCase"
  310. classpathref="classpath" />
  311. <available property="netcomp.present"
  312. classname="com.oroinc.net.ftp.FTPClient"
  313. classpathref="classpath" />
  314. <available property="starteam.present"
  315. classname="com.starbase.util.Platform"
  316. classpathref="classpath" />
  317. <available property="antlr.present"
  318. classname="antlr.Tool"
  319. classpathref="classpath"/>
  320. <available property="vaj.present"
  321. classname="com.ibm.ivj.util.base.Workspace"
  322. classpathref="classpath"/>
  323. <available property="stylebook.present"
  324. classname="org.apache.stylebook.Engine"
  325. classpathref="classpath"/>
  326. <available property="jakarta.regexp.present"
  327. classname="org.apache.regexp.RE"
  328. classpathref="classpath"/>
  329. <available property="jakarta.oro.present"
  330. classname="org.apache.oro.text.regex.Perl5Matcher"
  331. classpathref="classpath" />
  332. <available property="jmf.present"
  333. classname="javax.sound.sampled.Clip"
  334. classpathref="classpath"/>
  335. <available property="icontract.present"
  336. classname="com.reliablesystems.iContract.IContracted"
  337. classpathref="classpath"/>
  338. <available property="jdepend.present"
  339. classname="jdepend.framework.JDepend"
  340. classpathref="classpath"/>
  341. <available property="log4j.present"
  342. classname="org.apache.log4j.Category"
  343. classpathref="classpath"/>
  344. <!-- this is just a way to check for a TraX implementation -->
  345. <available property="trax.impl.present"
  346. resource="META-INF/services/javax.xml.transform.TransformerFactory"
  347. classpathref="classpath"/>
  348. <available property="xalan.envcheck"
  349. classname="org.apache.xalan.xslt.EnvironmentCheck"
  350. classpathref="classpath" />
  351. <available property="which.present"
  352. classname="org.apache.env.Which"
  353. classpathref="classpath" />
  354. <available property="servlet.present"
  355. classname="javax.servlet.Servlet"
  356. classpathref="classpath"/>
  357. <available property="xerces.present"
  358. classname="org.apache.xerces.parsers.SAXParser"
  359. classpathref="classpath" />
  360. <available property="bcel.present"
  361. classname="org.apache.bcel.Constants"
  362. classpathref="classpath" />
  363. <available property="sunuue.present"
  364. classname="sun.misc.UUEncoder"
  365. classpathref="classpath" />
  366. <condition property="javamail.complete">
  367. <and>
  368. <available classname="javax.activation.DataHandler"
  369. classpathref="classpath"/>
  370. <available classname="javax.mail.Transport"
  371. classpathref="classpath"/>
  372. </and>
  373. </condition>
  374. <condition property="some.regexp.support">
  375. <or>
  376. <isset property="jdk1.4+" />
  377. <isset property="jakarta.regexp.present" />
  378. <isset property="jakarta.oro.present" />
  379. </or>
  380. </condition>
  381. <condition property="tests.and.ant.share.classloader">
  382. <or>
  383. <equals arg1="${junit.fork}" arg2="true" />
  384. <equals arg1="${build.sysclasspath}" arg2="only" />
  385. </or>
  386. </condition>
  387. <condition property="sun.tools.present">
  388. <and>
  389. <available classname="sun.tools.native2ascii.Main" />
  390. <available classname="com.sun.tools.javah.Main" />
  391. </and>
  392. </condition>
  393. <available property="base64.present" classname="sun.misc.BASE64Encoder" />
  394. <property name="build.tests.resolved" location="${build.tests}" />
  395. <condition property="tests.are.on.system.classpath">
  396. <or>
  397. <!-- relative paths in CLASSPATH -->
  398. <contains string="${java.class.path}"
  399. substring="${build.tests}" />
  400. <!-- absolute paths in CLASSPATH -->
  401. <contains string="${java.class.path}"
  402. substring="${build.tests.resolved}" />
  403. </or>
  404. </condition>
  405. <condition property="jasper.present">
  406. <and>
  407. <available classname="org.apache.jasper.compiler.Compiler" />
  408. <available classname="org.apache.jasper.JasperException" />
  409. </and>
  410. </condition>
  411. <available property="swing.present"
  412. classname="javax.swing.ImageIcon"
  413. classpathref="classpath"/>
  414. </target>
  415. <!--
  416. ===================================================================
  417. Prepare the build
  418. ===================================================================
  419. -->
  420. <target name="prepare">
  421. <tstamp>
  422. <format property="year" pattern="yyyy" />
  423. </tstamp>
  424. <filterset id="ant.filters">
  425. <filter token="VERSION" value="${version}" />
  426. <filter token="DATE" value="${TODAY}" />
  427. <filter token="TIME" value="${TSTAMP}" />
  428. </filterset>
  429. </target>
  430. <!--
  431. ===================================================================
  432. Build the code
  433. ===================================================================
  434. -->
  435. <target name="build"
  436. depends="prepare, check_for_optional_packages"
  437. description="--> compiles the source code">
  438. <mkdir dir="${build.dir}"/>
  439. <mkdir dir="${build.classes}"/>
  440. <mkdir dir="${build.lib}"/>
  441. <javac srcdir="${java.dir}"
  442. destdir="${build.classes}"
  443. debug="${debug}"
  444. deprecation="${deprecation}"
  445. optimize="${optimize}" >
  446. <classpath refid="classpath" />
  447. <patternset refid="needs.jdk1.2+" />
  448. <patternset refid="needs.jdk1.4+" />
  449. <patternset refid="needs.jakarta.regexp" />
  450. <patternset refid="needs.jakarta.oro" />
  451. <patternset refid="needs.jakarta.log4j" />
  452. <patternset refid="needs.sun.uue" />
  453. <patternset refid="needs.javamail" />
  454. <patternset refid="needs.icontract" />
  455. <patternset refid="needs.bsf" />
  456. <patternset refid="needs.stylebook" />
  457. <patternset refid="needs.netrexx" />
  458. <patternset refid="needs.trax" />
  459. <patternset refid="needs.xslp" />
  460. <patternset refid="needs.xalan1" />
  461. <patternset refid="needs.weblogic.ejbc" />
  462. <patternset refid="needs.weblogic.ddcreator" />
  463. <patternset refid="needs.weblogic.server" />
  464. <patternset refid="needs.junit" />
  465. <patternset refid="needs.netcomponents" />
  466. <patternset refid="needs.starteam" />
  467. <patternset refid="needs.antlr" />
  468. <patternset refid="needs.vaj" />
  469. <patternset refid="needs.servletapi" />
  470. <patternset refid="needs.jmf" />
  471. <patternset refid="needs.xalan2" />
  472. <patternset refid="needs.jdepend" />
  473. <patternset refid="needs.sun.tools" />
  474. <patternset refid="needs.sun.b64" />
  475. <patternset refid="needs.jakarta.bcel" />
  476. <patternset refid="needs.swing" />
  477. </javac>
  478. <copy todir="${build.classes}">
  479. <fileset dir="${java.dir}">
  480. <include name="**/*.properties" />
  481. <include name="**/*.dtd" />
  482. </fileset>
  483. </copy>
  484. <copy todir="${build.classes}"
  485. overwrite="true">
  486. <fileset dir="${java.dir}">
  487. <include name="**/version.txt" />
  488. <include name="**/defaultManifest.mf" />
  489. </fileset>
  490. <filterset refid="ant.filters"/>
  491. </copy>
  492. <copy todir="${build.classes}/${optional.package}/junit/xsl">
  493. <fileset dir="${etc.dir}">
  494. <include name="junit-frames.xsl" />
  495. <include name="junit-noframes.xsl" />
  496. </fileset>
  497. </copy>
  498. </target>
  499. <!--
  500. ===================================================================
  501. Create the Apache Ant jars: ant.jar and optional.jar
  502. ===================================================================
  503. -->
  504. <target name="jars"
  505. depends="build"
  506. description="--> creates the Apache Ant jars">
  507. <copy todir="${build.dir}">
  508. <fileset dir=".">
  509. <include name="LICENSE" />
  510. <include name="LICENSE.crimson" />
  511. </fileset>
  512. <mapper type="glob" from="*" to="*.txt" />
  513. </copy>
  514. <jar destfile="${build.lib}/${name}.jar"
  515. basedir="${build.classes}"
  516. manifest="${manifest}">
  517. <exclude name="${optional.package}/**" />
  518. <exclude name="${optional.type.package}/**" />
  519. <exclude name="${util.package}/depend/**" />
  520. <exclude name="${util.package}/optional/**" />
  521. <exclude name="${util.package}/regexp/**" />
  522. <exclude name="${ant.package}/listener/Log4jListener.class" />
  523. <exclude name="${ant.package}/taskdefs/email/UUMailer.class" />
  524. <exclude name="${ant.package}/taskdefs/email/MimeMailer.class" />
  525. <exclude name="${ant.package}/taskdefs/Get.class" />
  526. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  527. <manifest>
  528. <section name="${ant.package}">
  529. <attribute name="Specification-Title"
  530. value="Apache Ant" />
  531. <attribute name="Specification-Version"
  532. value="${version}" />
  533. <attribute name="Specification-Vendor"
  534. value="Apache Software Foundation" />
  535. <attribute name="Implementation-Title"
  536. value="org.apache.tools.ant" />
  537. <attribute name="Implementation-Version"
  538. value="${version} ${TODAY}" />
  539. <attribute name="Implementation-Vendor"
  540. value="Apache Software Foundation" />
  541. </section>
  542. </manifest>
  543. <fileset dir="${docs.dir}">
  544. <include name="images/ant_logo_large.gif" />
  545. </fileset>
  546. </jar>
  547. <jar destfile="${build.lib}/optional.jar"
  548. basedir="${build.classes}"
  549. manifest="${manifest}">
  550. <include name="${optional.package}/**" />
  551. <include name="${optional.type.package}/**" />
  552. <include name="${util.package}/depend/**" />
  553. <include name="${util.package}/optional/**" />
  554. <include name="${util.package}/regexp/**" />
  555. <include name="${ant.package}/listener/Log4jListener.class" />
  556. <include name="${ant.package}/taskdefs/email/UUMailer.class" />
  557. <include name="${ant.package}/taskdefs/email/MimeMailer.class" />
  558. <include name="${ant.package}/taskdefs/Get.class" />
  559. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  560. <manifest>
  561. <section name="${optional.package}">
  562. <attribute name="Specification-Title"
  563. value="Apache Ant Optional Tasks" />
  564. <attribute name="Specification-Version"
  565. value="${version}" />
  566. <attribute name="Specification-Vendor"
  567. value="Apache Software Foundation" />
  568. <attribute name="Implementation-Title"
  569. value="org.apache.tools.ant.taskdefs.optional" />
  570. <attribute name="Implementation-Version"
  571. value="${version} ${TODAY}" />
  572. <attribute name="Implementation-Vendor"
  573. value="Apache Software Foundation" />
  574. </section>
  575. </manifest>
  576. </jar>
  577. </target>
  578. <!--
  579. ===================================================================
  580. Create the essential distribution that can run Apache Ant
  581. ===================================================================
  582. -->
  583. <target name="dist-lite"
  584. depends="jars"
  585. description="--> creates a minimum distribution to run Apache Ant">
  586. <mkdir dir="${dist.dir}"/>
  587. <mkdir dir="${dist.bin}"/>
  588. <mkdir dir="${dist.lib}"/>
  589. <copy todir="${dist.lib}">
  590. <fileset dir="${build.lib}"/>
  591. </copy>
  592. <copy todir="${dist.bin}">
  593. <fileset dir="${script.dir}/" />
  594. </copy>
  595. <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="*.bat" />
  596. <fixcrlf srcdir="${dist.bin}" eol="lf">
  597. <include name="ant" />
  598. <include name="antRun" />
  599. <include name="*.pl" />
  600. </fixcrlf>
  601. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  602. failonerror="${chmod.fail}" />
  603. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  604. failonerror="${chmod.fail}" />
  605. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  606. <fileset dir="${dist.bin}">
  607. <include name="**/ant" />
  608. <include name="**/antRun" />
  609. <include name="**/*.pl" />
  610. <include name="**/*.py" />
  611. </fileset>
  612. </chmod>
  613. </target>
  614. <!--
  615. ===================================================================
  616. Create the complete distribution
  617. ===================================================================
  618. -->
  619. <target name="dist" description="--> creates a complete distribution">
  620. <antcall inheritAll="false" target="internal_dist">
  621. <param name="dist.dir" value="${dist.name}" />
  622. </antcall>
  623. </target>
  624. <target name="dist_javadocs" depends="javadocs">
  625. <mkdir dir="${dist.javadocs}"/>
  626. <copy todir="${dist.javadocs}" overwrite="true">
  627. <fileset dir="${build.javadocs}"/>
  628. </copy>
  629. </target>
  630. <target name="internal_dist" depends="dist-lite,dist_javadocs">
  631. <mkdir dir="${dist.docs}"/>
  632. <mkdir dir="${dist.etc}"/>
  633. <copy todir="${dist.lib}">
  634. <fileset dir="${lib.dir}">
  635. <include name="*.jar" />
  636. <include name="*.zip" />
  637. </fileset>
  638. </copy>
  639. <copy todir="${dist.lib}" file="${lib.dir}/README"/>
  640. <copy todir="${dist.docs}">
  641. <fileset dir="${docs.dir}">
  642. <exclude name="**/images/**"/>
  643. </fileset>
  644. <filterset refid="ant.filters"/>
  645. </copy>
  646. <copy todir="${dist.docs}" filtering="false">
  647. <fileset dir="${docs.dir}">
  648. <include name="**/images/**"/>
  649. </fileset>
  650. </copy>
  651. <copy todir="${dist.dir}">
  652. <fileset dir=".">
  653. <include name="README"/>
  654. <include name="LICENSE"/>
  655. <include name="LICENSE.crimson"/>
  656. <include name="TODO"/>
  657. <include name="WHATSNEW"/>
  658. <include name="KEYS"/>
  659. </fileset>
  660. </copy>
  661. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  662. failonerror="${chmod.fail}" />
  663. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  664. failonerror="${chmod.fail}" />
  665. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  666. <fileset dir="${dist.bin}">
  667. <include name="**/ant" />
  668. <include name="**/antRun" />
  669. <include name="**/*.pl" />
  670. <include name="**/*.py" />
  671. </fileset>
  672. </chmod>
  673. <!-- publish some useful stylesheets -->
  674. <copy todir="${dist.etc}">
  675. <fileset dir="${etc.dir}">
  676. <include name="junit-frames.xsl"/>
  677. <include name="junit-noframes.xsl"/>
  678. <include name="coverage-frames.xsl"/>
  679. <include name="maudit-frames.xsl"/>
  680. <include name="mmetrics-frames.xsl"/>
  681. <include name="jdepend.xsl"/>
  682. <include name="jdepend-frames.xsl"/>
  683. <include name="checkstyle-frames.xsl"/>
  684. <include name="log.xsl"/>
  685. </fileset>
  686. </copy>
  687. </target>
  688. <!--
  689. ===================================================================
  690. Target to create bootstrap build
  691. ===================================================================
  692. -->
  693. <target name="bootstrap" description="--> creates a bootstrap build">
  694. <antcall inheritAll="false" target="dist-lite">
  695. <param name="dist.dir" value="${bootstrap.dir}" />
  696. </antcall>
  697. </target>
  698. <!--
  699. ===================================================================
  700. Create the source distribution
  701. ===================================================================
  702. -->
  703. <target name="src-dist"
  704. description="--> creates a source distribution">
  705. <mkdir dir="${src.dist.dir}" />
  706. <copy todir="${src.dist.lib}">
  707. <fileset dir="${lib.dir}">
  708. <include name="*.jar" />
  709. <include name="*.zip" />
  710. <include name="README"/>
  711. </fileset>
  712. </copy>
  713. <copy todir="${src.dist.src}">
  714. <fileset dir="${src.dir}"/>
  715. </copy>
  716. <copy todir="${src.dist.docs}">
  717. <fileset dir="${docs.dir}">
  718. <exclude name="manual/api/**"/>
  719. </fileset>
  720. </copy>
  721. <copy todir="${src.dist.dir}">
  722. <fileset dir=".">
  723. <include name="README"/>
  724. <include name="LICENSE"/>
  725. <include name="LICENSE.crimson"/>
  726. <include name="TODO"/>
  727. <include name="WHATSNEW"/>
  728. <include name="KEYS"/>
  729. <include name="build.bat"/>
  730. <include name="build.sh"/>
  731. <include name="bootstrap.bat"/>
  732. <include name="bootstrap.sh"/>
  733. <include name="build.xml"/>
  734. </fileset>
  735. </copy>
  736. <fixcrlf srcdir="${src.dist.dir}" eol="crlf" includes="*.bat" />
  737. <fixcrlf srcdir="${src.dist.dir}" eol="lf">
  738. <include name="**/*.sh" />
  739. <include name="**/*.pl" />
  740. <include name="**/ant" />
  741. <include name="**/antRun" />
  742. </fixcrlf>
  743. <fixcrlf srcdir="${src.dist.dir}">
  744. <include name="**/*.java" />
  745. </fixcrlf>
  746. <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
  747. failonerror="${chmod.fail}" />
  748. <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}" />
  749. <chmod perm="ugo+x" failonerror="${chmod.fail}">
  750. <fileset dir="${src.dist.dir}">
  751. <include name="**/.sh" />
  752. <include name="**/.pl" />
  753. <include name="**/.py" />
  754. <include name="**/ant" />
  755. <include name="**/antRun" />
  756. </fileset>
  757. </chmod>
  758. </target>
  759. <!--
  760. ===================================================================
  761. Create the binary distribution
  762. ===================================================================
  763. -->
  764. <target name="main_distribution"
  765. description="--> creates the zip and tar distributions">
  766. <delete dir="${dist.name}" />
  767. <mkdir dir="${dist.base}"/>
  768. <mkdir dir="${dist.base}/src"/>
  769. <mkdir dir="${dist.base}/bin"/>
  770. <antcall inheritAll="false" target="internal_dist">
  771. <param name="dist.dir" value="${dist.name}" />
  772. </antcall>
  773. <zip destfile="${dist.base}/bin/${dist.name}-bin.zip"
  774. basedir="${dist.name}/.."
  775. includes="${dist.name}/**"/>
  776. <tar longfile="gnu"
  777. destfile="${dist.base}/bin/${dist.name}-bin.tar">
  778. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  779. <include name="${dist.name}/bin/ant"/>
  780. <include name="${dist.name}/bin/antRun"/>
  781. <include name="${dist.name}/bin/*.pl"/>
  782. <include name="${dist.name}/bin/*.py"/>
  783. </tarfileset>
  784. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  785. <include name="${dist.name}/**"/>
  786. <exclude name="${dist.name}/bin/ant"/>
  787. <exclude name="${dist.name}/bin/antRun"/>
  788. <include name="${dist.name}/bin/*.pl"/>
  789. <include name="${dist.name}/bin/*.py"/>
  790. </tarfileset>
  791. </tar>
  792. <gzip zipfile="${dist.base}/bin/${dist.name}-bin.tar.gz"
  793. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  794. <bzip2 zipfile="${dist.base}/bin/${dist.name}-bin.tar.bz2"
  795. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  796. <delete file="${dist.base}/bin/${dist.name}-bin.tar"/>
  797. <delete dir="${dist.name}" />
  798. <checksum fileext=".md5">
  799. <fileset dir="${dist.base}/bin/" />
  800. </checksum>
  801. <antcall inheritAll="false" target="src-dist">
  802. <param name="src.dist.dir" value="${dist.name}" />
  803. </antcall>
  804. <zip destfile="${dist.base}/src/${dist.name}-src.zip"
  805. basedir="${dist.name}/.."
  806. includes="${dist.name}/**"/>
  807. <tar longfile="gnu"
  808. destfile="${dist.base}/src/${dist.name}-src.tar" >
  809. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  810. <include name="${dist.name}/bootstrap.sh"/>
  811. <include name="${dist.name}/build.sh"/>
  812. </tarfileset>
  813. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  814. <include name="${dist.name}/**"/>
  815. <exclude name="${dist.name}/bootstrap.sh"/>
  816. <exclude name="${dist.name}/build.sh"/>
  817. </tarfileset>
  818. </tar>
  819. <gzip zipfile="${dist.base}/src/${dist.name}-src.tar.gz"
  820. src="${dist.base}/src/${dist.name}-src.tar"/>
  821. <bzip2 zipfile="${dist.base}/src/${dist.name}-src.tar.bz2"
  822. src="${dist.base}/src/${dist.name}-src.tar"/>
  823. <delete file="${dist.base}/src/${dist.name}-src.tar"/>
  824. <delete dir="${dist.name}" />
  825. <checksum fileext=".md5">
  826. <fileset dir="${dist.base}/src/" />
  827. </checksum>
  828. </target>
  829. <target name="rpm_check">
  830. <available property="rpm.present"
  831. file="/bin/rpm"/>
  832. </target>
  833. <target name="rpm" description="Build the RPM files for ant"
  834. depends="prepare, rpm_check"
  835. if="rpm.present">
  836. <tstamp>
  837. <format property="rpmyear" pattern="yyyyMMdd"/>
  838. <format property="nightlybuild.dir" pattern="yyyy-MM-dd"/>
  839. </tstamp>
  840. <property name="rpm.release" value="cvs${rpmyear}"/>
  841. <property name="rpm.source" value="nightly/${nightlybuild.dir}/"/>
  842. <mkdir dir="build/rpm/SPECS"/>
  843. <mkdir dir="build/rpm/SOURCES"/>
  844. <mkdir dir="build/rpm/BUILD"/>
  845. <mkdir dir="build/rpm/RPMS"/>
  846. <mkdir dir="build/rpm/SRPMS"/>
  847. <property name="disttar" location="${dist.base}/bin/${dist.name}-bin.tar.gz"/>
  848. <copy file="src/etc/ant.spec" tofile="build/rpm/SPECS/ant.spec">
  849. <filterset refid="ant.filters"/>
  850. <filterset>
  851. <filter token="RPM_RELEASE" value="${rpm.release}"/>
  852. <filter token="RPM_SOURCE" value="${rpm.source}"/>
  853. <filter token="DIST_TAR" value="${disttar}"/>
  854. </filterset>
  855. </copy>
  856. <copy file="src/etc/antsrc.spec" tofile="build/rpm/SPECS/antsrc.spec">
  857. <filterset refid="ant.filters"/>
  858. <filterset>
  859. <filter token="RPM_RELEASE" value="${rpm.release}"/>
  860. <filter token="RPM_SOURCE" value="${rpm.source}"/>
  861. </filterset>
  862. </copy>
  863. <rpm topDir="build/rpm"
  864. specfile="ant.spec"
  865. command="-bb"/>
  866. <copy file="distribution/src/${dist.name}-src.tar.gz" todir="build/rpm/SOURCES"/>
  867. <rpm topDir="build/rpm"
  868. specfile="antsrc.spec"
  869. command="-bs"/>
  870. <mkdir dir="${dist.base}/rpms"/>
  871. <copy todir="${dist.base}/rpms">
  872. <fileset dir="build/rpm/RPMS/noarch"/>
  873. </copy>
  874. <copy todir="${dist.base}/rpms">
  875. <fileset dir="build/rpm/SRPMS"/>
  876. </copy>
  877. </target>
  878. <target name="distribution" depends="main_distribution, rpm">
  879. </target>
  880. <!--
  881. ===================================================================
  882. Cleans up build and distribution directories
  883. ===================================================================
  884. -->
  885. <target name="clean"
  886. description="--> cleans up build and dist directories">
  887. <delete dir="${build.dir}" />
  888. <delete dir="${dist.base}" />
  889. <delete dir="${dist.dir}" />
  890. <delete>
  891. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  892. </delete>
  893. </target>
  894. <!--
  895. ===================================================================
  896. Cleans everything
  897. ===================================================================
  898. -->
  899. <target name="allclean"
  900. depends="clean"
  901. description="--> cleans up everything">
  902. <delete file="${bootstrap.dir}/bin/antRun" />
  903. <delete file="${bootstrap.dir}/bin/antRun.bat" />
  904. <delete file="${bootstrap.dir}/bin/*.pl" />
  905. <delete file="${bootstrap.dir}/bin/*.py" />
  906. </target>
  907. <!--
  908. ===================================================================
  909. Installs Apache Ant
  910. ===================================================================
  911. -->
  912. <target name="install" if="ant.install">
  913. <antcall inheritAll="false" target="internal_dist">
  914. <param name="dist.dir" value="${ant.install}" />
  915. </antcall>
  916. </target>
  917. <target name="install-lite" if="ant.install">
  918. <antcall inheritAll="false" target="dist-lite">
  919. <param name="dist.dir" value="${ant.install}" />
  920. </antcall>
  921. </target>
  922. <!--
  923. ===================================================================
  924. Creates the API documentation
  925. ===================================================================
  926. -->
  927. <target name="javadoc_check">
  928. <uptodate property="javadoc.notrequired"
  929. targetfile="${build.javadocs}/packages.html" >
  930. <srcfiles dir= "${java.dir}" includes="**/*.java"/>
  931. </uptodate>
  932. </target>
  933. <target name="javadocs" depends="prepare, javadoc_check"
  934. unless="javadoc.notrequired"
  935. description="--> creates the API documentation">
  936. <mkdir dir="${build.javadocs}"/>
  937. <javadoc packagenames="org.apache.*"
  938. useexternalfile="yes"
  939. sourcepath="${java.dir}"
  940. destdir="${build.javadocs}"
  941. author="true"
  942. version="true"
  943. windowtitle="${Name} API"
  944. doctitle="${Name}">
  945. <tag name="todo" description="To do:" scope="all" />
  946. <tag name="ant.task" enabled="false" description="Task:" scope="types" />
  947. <tag name="ant.datatype" enabled="false" description="Data type:" scope="types" />
  948. <group title="Apache Ant Core" packages="org.apache.tools.ant*" />
  949. <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*" />
  950. <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*" />
  951. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  952. </javadoc>
  953. </target>
  954. <!--
  955. ===================================================================
  956. Compile testcases
  957. ===================================================================
  958. -->
  959. <target name="compile-tests" depends="build" if="junit.present">
  960. <mkdir dir="${build.tests}"/>
  961. <javac srcdir="${tests.dir}"
  962. destdir="${build.tests}"
  963. debug="${debug}"
  964. deprecation="${deprecation}" >
  965. <classpath refid="tests-classpath" />
  966. <patternset refid="needs.antlr" />
  967. <patternset refid="needs.jdk1.2+" />
  968. <patternset refid="needs.jdk1.3+" />
  969. <patternset refid="needs.jdk1.4+" />
  970. <patternset refid="needs.jakarta.regexp" />
  971. <patternset refid="needs.jakarta.oro" />
  972. <patternset refid="needs.trax" />
  973. <patternset refid="needs.xslp" />
  974. <patternset refid="needs.xalan1" />
  975. </javac>
  976. </target>
  977. <target name="dump-info" depends="dump-sys-properties,run-which" />
  978. <target name="dump-sys-properties" unless="which.present"
  979. depends="xml-check">
  980. <echo message="java.vm.info=${java.vm.info}" />
  981. <echo message="java.vm.name=${java.vm.name}" />
  982. <echo message="java.vm.vendor=${java.vm.vendor}" />
  983. <echo message="java.vm.version=${java.vm.version}" />
  984. <echo message="os.arch=${os.arch}" />
  985. <echo message="os.name=${os.name}" />
  986. <echo message="os.version=${os.version}" />
  987. <echo message="file.encoding=${file.encoding}" />
  988. <echo message="user.language=${user.language}" />
  989. </target>
  990. <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
  991. <target name="xml-check" depends="check_for_optional_packages"
  992. if="xalan.envcheck" unless="which.present">
  993. <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
  994. </target>
  995. <target name="run-which" depends="check_for_optional_packages"
  996. if="which.present">
  997. <java classname="org.apache.env.Which" taskname="which"/>
  998. </target>
  999. <!-- test to see if we are online or not. can take a while when we are off line, so
  1000. setting the property is a good shortcut-->
  1001. <target name="probe-offline">
  1002. <condition property="offline">
  1003. <or>
  1004. <isset property="offline"/>
  1005. <not>
  1006. <http url="http://www.apache.org/"/>
  1007. </not>
  1008. </or>
  1009. </condition>
  1010. <echo level="verbose" > offline=${offline}</echo>
  1011. </target>
  1012. <!--
  1013. ===================================================================
  1014. Run testcase
  1015. ===================================================================
  1016. -->
  1017. <target name="test" depends="run-tests" description="--> run JUnit tests"/>
  1018. <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present">
  1019. <junit printsummary="${junit.summary}" haltonfailure="yes"
  1020. filtertrace="${junit.filtertrace}"
  1021. fork="${junit.fork}">
  1022. <!-- <jvmarg value="-classic"/> -->
  1023. <classpath refid="tests-classpath"/>
  1024. <classpath refid="classes.zip" />
  1025. <sysproperty key="ant.home" value="${ant.home}" />
  1026. <sysproperty key="build.tests" value="${build.tests}"/>
  1027. <sysproperty key="tests-classpath.value"
  1028. value="${tests-classpath.value}" />
  1029. <formatter type="brief" usefile="false" />
  1030. <batchtest>
  1031. <fileset dir="${tests.dir}">
  1032. <include name="**/*Test*" />
  1033. <!-- abstract classes, not testcases -->
  1034. <exclude name="${ant.package}/taskdefs/TaskdefsTest.java" />
  1035. <exclude name="${ant.package}/BuildFileTest.java" />
  1036. <exclude name="${regexp.package}/RegexpMatcherTest.java" />
  1037. <exclude name="${regexp.package}/RegexpTest.java" />
  1038. <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java" />
  1039. <!-- helper classes, not testcases -->
  1040. <exclude name="org/example/**" />
  1041. <exclude name="${ant.package}/taskdefs/TaskdefTest*Task.java" />
  1042. <!-- interactive test -->
  1043. <exclude name="${ant.package}/taskdefs/TestProcess.java" />
  1044. <!-- only run these tests if their required libraries are
  1045. installed -->
  1046. <patternset refid="needs.jdk1.2+" />
  1047. <patternset refid="needs.jdk1.4+" />
  1048. <patternset refid="needs.jakarta.regexp" />
  1049. <patternset refid="needs.jakarta.oro" />
  1050. <patternset refid="needs.vaj" />
  1051. <patternset refid="needs.antlr" />
  1052. <patternset refid="needs.xalan1" />
  1053. <patternset refid="needs.xslp" />
  1054. <!-- tests excluded if the test is run in offline mode -->
  1055. <patternset refid="onlinetests"/>
  1056. <!-- runtime dependencies that are different from compile
  1057. time dependencies -->
  1058. <exclude name="${optional.package}/ReplaceRegExpTest.java"
  1059. unless="some.regexp.support" />
  1060. <exclude name="${optional.package}/sitraka/*.java"
  1061. unless="some.regexp.support" />
  1062. <!-- fail if testcases can be loaded from the system classloader -->
  1063. <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  1064. if="tests.are.on.system.classpath"/>
  1065. <exclude name="${optional.package}/sitraka/XMLReportTest.java"
  1066. if="tests.are.on.system.classpath"/>
  1067. <!-- these tests need to be localised before being ran???? -->
  1068. <exclude name="${optional.package}/PvcsTest.java" />
  1069. <!-- ehm, this is not really a TraX test but rather a xalan2 test..-->
  1070. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1071. unless="xalan2.present"/>
  1072. <!-- needs BSF to work -->
  1073. <exclude name="${optional.package}/XalanLiaisonTest.java"
  1074. unless="bsf.present" />
  1075. <!--
  1076. XXX need to figure out what's causing this InvocationTargetException
  1077. -->
  1078. <exclude name="${optional.package}/junit/JUnitTestRunnerTest.java"
  1079. unless="jdk1.2+" />
  1080. <!-- DateTime handling seems to be broken in JDK 1.1 -->
  1081. <exclude name="${util.package}/DateUtilsTest.java"
  1082. unless="jdk1.2+" />
  1083. <exclude name="${optional.package}/JspcTest.java"
  1084. unless="jasper.present" />
  1085. <!-- These tests only passes if testcases and Ant classes have
  1086. been loaded by the same classloader - will throw
  1087. IllegalAccessExceptions otherwise. -->
  1088. <exclude name="${ant.package}/taskdefs/SQLExecTest.java"
  1089. unless="tests.and.ant.share.classloader" />
  1090. <exclude name="${optional.package}/sos/SOSTest.java"
  1091. unless="tests.and.ant.share.classloader" />
  1092. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1093. unless="tests.and.ant.share.classloader" />
  1094. <exclude name="${optional.package}/metamata/MAuditParserTest.java"
  1095. unless="tests.and.ant.share.classloader" />
  1096. <!-- failure of this test case kills the current JVM
  1097. so until the defect is actually fixed it is taken
  1098. out of the test list -->
  1099. <exclude name="${ant.package}/taskdefs/JavaTest.java" />
  1100. </fileset>
  1101. </batchtest>
  1102. </junit>
  1103. </target>
  1104. <target name="run-single-test" if="testcase" depends="compile-tests"
  1105. description="--> runs the single unit test defined in the testcase property">
  1106. <junit printsummary="${junit.summary}"
  1107. haltonfailure="yes"
  1108. fork="${junit.fork}"
  1109. filtertrace="${junit.filtertrace}">
  1110. <!-- <jvmarg value="-classic"/> -->
  1111. <sysproperty key="ant.home" value="${ant.home}" />
  1112. <sysproperty key="build.tests" value="${build.tests}"/>
  1113. <sysproperty key="tests-classpath.value"
  1114. value="${tests-classpath.value}" />
  1115. <classpath refid="classes.zip" />
  1116. <classpath refid="tests-classpath"/>
  1117. <formatter type="plain" usefile="false" />
  1118. <test name="${testcase}" />
  1119. </junit>
  1120. </target>
  1121. <target name="interactive-tests" description="--> runs interactive tests"
  1122. depends="compile-tests"
  1123. if="jdk1.3+">
  1124. <java classpathref="tests-classpath"
  1125. classname="org.apache.tools.ant.taskdefs.TestProcess"
  1126. fork="true" />
  1127. </target>
  1128. <!--
  1129. ===================================================================
  1130. Main target - runs dist-lite by default
  1131. ===================================================================
  1132. -->
  1133. <target name="main"
  1134. description="--> creates a minimum distribution in ./dist"
  1135. depends="dist-lite" />
  1136. </project>