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

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