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

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