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

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