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

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