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

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