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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434
  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}.bootstrap">
  690. <include name="${ant.package}/Main.class"/>
  691. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  692. </jar>
  693. </target>
  694. <!-- Creates jar of test utility classes -->
  695. <target name="test-jar"
  696. depends="compile-tests"
  697. description="--> creates the Apache Ant Test Utilties jar">
  698. <jar destfile="${build.lib}/${name}-testutil.jar"
  699. basedir="${build.tests}">
  700. <patternset refid="useful.tests"/>
  701. </jar>
  702. </target>
  703. <!--
  704. ===================================================================
  705. Create the essential distribution that can run Apache Ant
  706. ===================================================================
  707. -->
  708. <target name="dist-lite"
  709. depends="jars"
  710. description="--> creates a minimum distribution to run Apache Ant">
  711. <mkdir dir="${dist.dir}"/>
  712. <mkdir dir="${dist.bin}"/>
  713. <mkdir dir="${dist.lib}"/>
  714. <copy todir="${dist.lib}">
  715. <fileset dir="${build.lib}">
  716. <exclude name="${bootstrap.jar}"/>
  717. </fileset>
  718. </copy>
  719. <copy todir="${dist.bin}">
  720. <fileset dir="${script.dir}/"/>
  721. </copy>
  722. <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="*.bat"/>
  723. <fixcrlf srcdir="${dist.bin}" eol="lf">
  724. <include name="ant"/>
  725. <include name="antRun"/>
  726. <include name="*.pl"/>
  727. </fixcrlf>
  728. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  729. failonerror="${chmod.fail}"/>
  730. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  731. failonerror="${chmod.fail}"/>
  732. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  733. <fileset dir="${dist.bin}">
  734. <include name="**/ant"/>
  735. <include name="**/antRun"/>
  736. <include name="**/*.pl"/>
  737. <include name="**/*.py"/>
  738. </fileset>
  739. </chmod>
  740. </target>
  741. <!--
  742. ===================================================================
  743. Create the complete distribution
  744. ===================================================================
  745. -->
  746. <target name="dist" description="--> creates a complete distribution">
  747. <antcall inheritAll="false" target="internal_dist">
  748. <param name="dist.dir" value="${dist.name}"/>
  749. </antcall>
  750. </target>
  751. <target name="dist_javadocs" depends="javadocs">
  752. <mkdir dir="${dist.javadocs}"/>
  753. <copy todir="${dist.javadocs}" overwrite="true">
  754. <fileset dir="${build.javadocs}"/>
  755. </copy>
  756. </target>
  757. <target name="internal_dist" depends="dist-lite,dist_javadocs">
  758. <mkdir dir="${dist.docs}"/>
  759. <mkdir dir="${dist.etc}"/>
  760. <copy todir="${dist.lib}">
  761. <fileset dir="${lib.dir}">
  762. <include name="*.jar"/>
  763. <include name="*.zip"/>
  764. </fileset>
  765. </copy>
  766. <copy todir="${dist.lib}" file="${lib.dir}/README"/>
  767. <copy todir="${dist.docs}">
  768. <fileset dir="${docs.dir}" excludes="${unfiltered.files}"/>
  769. <filterchain refid="ant.filters"/>
  770. </copy>
  771. <copy todir="${dist.docs}" filtering="false">
  772. <fileset dir="${docs.dir}" includes="${unfiltered.files}"/>
  773. </copy>
  774. <copy todir="${dist.dir}">
  775. <fileset dir=".">
  776. <include name="README"/>
  777. <include name="LICENSE"/>
  778. <include name="LICENSE.xerces"/>
  779. <include name="LICENSE.dom"/>
  780. <include name="LICENSE.sax"/>
  781. <include name="TODO"/>
  782. <include name="WHATSNEW"/>
  783. <include name="KEYS"/>
  784. <include name="welcome.html"/>
  785. </fileset>
  786. </copy>
  787. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  788. failonerror="${chmod.fail}"/>
  789. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  790. failonerror="${chmod.fail}"/>
  791. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  792. <fileset dir="${dist.bin}">
  793. <include name="**/ant"/>
  794. <include name="**/antRun"/>
  795. <include name="**/*.pl"/>
  796. <include name="**/*.py"/>
  797. </fileset>
  798. </chmod>
  799. <!-- publish some useful stylesheets -->
  800. <copy todir="${dist.etc}">
  801. <fileset dir="${etc.dir}">
  802. <include name="junit-frames.xsl"/>
  803. <include name="junit-noframes.xsl"/>
  804. <include name="coverage-frames.xsl"/>
  805. <include name="maudit-frames.xsl"/>
  806. <include name="mmetrics-frames.xsl"/>
  807. <include name="changelog.xsl"/>
  808. <include name="jdepend.xsl"/>
  809. <include name="jdepend-frames.xsl"/>
  810. <include name="checkstyle-frames.xsl"/>
  811. <include name="log.xsl"/>
  812. <include name="tagdiff.xsl"/>
  813. </fileset>
  814. <fileset dir="${build.lib}">
  815. <include name="${bootstrap.jar}"/>
  816. </fileset>
  817. </copy>
  818. </target>
  819. <!--
  820. ===================================================================
  821. Target to create bootstrap build
  822. ===================================================================
  823. -->
  824. <target name="bootstrap" description="--> creates a bootstrap build">
  825. <antcall inheritAll="false" target="dist-lite">
  826. <param name="dist.dir" value="${bootstrap.dir}"/>
  827. </antcall>
  828. </target>
  829. <!--
  830. ===================================================================
  831. Create the source distribution
  832. ===================================================================
  833. -->
  834. <target name="src-dist"
  835. description="--> creates a source distribution">
  836. <mkdir dir="${src.dist.dir}"/>
  837. <copy todir="${src.dist.lib}">
  838. <fileset dir="${lib.dir}">
  839. <include name="*.jar"/>
  840. <include name="*.zip"/>
  841. <include name="README"/>
  842. </fileset>
  843. </copy>
  844. <copy todir="${src.dist.src}">
  845. <fileset dir="${src.dir}"/>
  846. </copy>
  847. <copy todir="${src.dist.docs}">
  848. <fileset dir="${docs.dir}">
  849. <exclude name="manual/api/**"/>
  850. </fileset>
  851. </copy>
  852. <copy todir="${src.dist.dir}">
  853. <fileset dir=".">
  854. <include name="README"/>
  855. <include name="LICENSE"/>
  856. <include name="LICENSE.xerces"/>
  857. <include name="LICENSE.dom"/>
  858. <include name="LICENSE.sax"/>
  859. <include name="TODO"/>
  860. <include name="WHATSNEW"/>
  861. <include name="KEYS"/>
  862. <include name="build.bat"/>
  863. <include name="build.sh"/>
  864. <include name="bootstrap.bat"/>
  865. <include name="bootstrap.sh"/>
  866. <include name="build.xml"/>
  867. <include name="welcome.html"/>
  868. </fileset>
  869. </copy>
  870. <fixcrlf srcdir="${src.dist.dir}" eol="crlf" includes="*.bat"/>
  871. <fixcrlf srcdir="${src.dist.dir}" eol="lf">
  872. <include name="**/*.sh"/>
  873. <include name="**/*.pl"/>
  874. <include name="**/ant"/>
  875. <include name="**/antRun"/>
  876. </fixcrlf>
  877. <fixcrlf srcdir="${src.dist.dir}">
  878. <include name="**/*.java"/>
  879. </fixcrlf>
  880. <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
  881. failonerror="${chmod.fail}"/>
  882. <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}"/>
  883. <chmod perm="ugo+x" failonerror="${chmod.fail}">
  884. <fileset dir="${src.dist.dir}">
  885. <include name="**/.sh"/>
  886. <include name="**/.pl"/>
  887. <include name="**/.py"/>
  888. <include name="**/ant"/>
  889. <include name="**/antRun"/>
  890. </fileset>
  891. </chmod>
  892. </target>
  893. <!--
  894. ===================================================================
  895. Create the binary distribution
  896. ===================================================================
  897. -->
  898. <target name="main_distribution"
  899. description="--> creates the zip and tar distributions">
  900. <delete dir="${dist.name}"/>
  901. <mkdir dir="${dist.base}"/>
  902. <mkdir dir="${dist.base}/src"/>
  903. <mkdir dir="${dist.base}/bin"/>
  904. <antcall inheritAll="false" target="internal_dist">
  905. <param name="dist.dir" value="${dist.name}"/>
  906. </antcall>
  907. <zip destfile="${dist.base}/bin/${dist.name}-bin.zip"
  908. basedir="${dist.name}/.."
  909. includes="${dist.name}/**"/>
  910. <tar longfile="gnu"
  911. destfile="${dist.base}/bin/${dist.name}-bin.tar">
  912. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  913. <include name="${dist.name}/bin/ant"/>
  914. <include name="${dist.name}/bin/antRun"/>
  915. <include name="${dist.name}/bin/*.pl"/>
  916. <include name="${dist.name}/bin/*.py"/>
  917. </tarfileset>
  918. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  919. <include name="${dist.name}/**"/>
  920. <exclude name="${dist.name}/bin/ant"/>
  921. <exclude name="${dist.name}/bin/antRun"/>
  922. <exclude name="${dist.name}/bin/*.pl"/>
  923. <exclude name="${dist.name}/bin/*.py"/>
  924. </tarfileset>
  925. </tar>
  926. <gzip zipfile="${dist.base}/bin/${dist.name}-bin.tar.gz"
  927. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  928. <bzip2 zipfile="${dist.base}/bin/${dist.name}-bin.tar.bz2"
  929. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  930. <delete file="${dist.base}/bin/${dist.name}-bin.tar"/>
  931. <delete dir="${dist.name}"/>
  932. <checksum fileext=".md5">
  933. <fileset dir="${dist.base}/bin/">
  934. <include name="**/*"/>
  935. <exclude name="**/*.asc"/>
  936. <exclude name="**/*.md5"/>
  937. </fileset>
  938. </checksum>
  939. <antcall inheritAll="false" target="src-dist">
  940. <param name="src.dist.dir" value="${dist.name}"/>
  941. </antcall>
  942. <zip destfile="${dist.base}/src/${dist.name}-src.zip"
  943. basedir="${dist.name}/.."
  944. includes="${dist.name}/**"/>
  945. <tar longfile="gnu"
  946. destfile="${dist.base}/src/${dist.name}-src.tar" >
  947. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  948. <include name="${dist.name}/bootstrap.sh"/>
  949. <include name="${dist.name}/build.sh"/>
  950. </tarfileset>
  951. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  952. <include name="${dist.name}/**"/>
  953. <exclude name="${dist.name}/bootstrap.sh"/>
  954. <exclude name="${dist.name}/build.sh"/>
  955. </tarfileset>
  956. </tar>
  957. <gzip zipfile="${dist.base}/src/${dist.name}-src.tar.gz"
  958. src="${dist.base}/src/${dist.name}-src.tar"/>
  959. <bzip2 zipfile="${dist.base}/src/${dist.name}-src.tar.bz2"
  960. src="${dist.base}/src/${dist.name}-src.tar"/>
  961. <delete file="${dist.base}/src/${dist.name}-src.tar"/>
  962. <delete dir="${dist.name}"/>
  963. <checksum fileext=".md5">
  964. <fileset dir="${dist.base}/src/">
  965. <include name="**/*"/>
  966. <exclude name="**/*.asc"/>
  967. <exclude name="**/*.md5"/>
  968. </fileset>
  969. </checksum>
  970. </target>
  971. <target name="distribution" depends="main_distribution"
  972. description="--> creates the full Apache Ant distribution">
  973. </target>
  974. <!--
  975. ===================================================================
  976. Cleans up build and distribution directories
  977. ===================================================================
  978. -->
  979. <target name="clean"
  980. description="--> cleans up build and dist directories">
  981. <delete dir="${build.dir}"/>
  982. <delete dir="${dist.base}"/>
  983. <delete dir="${dist.dir}"/>
  984. <delete>
  985. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  986. </delete>
  987. </target>
  988. <!--
  989. ===================================================================
  990. Cleans everything
  991. ===================================================================
  992. -->
  993. <target name="allclean"
  994. depends="clean"
  995. description="--> cleans up everything">
  996. <delete file="${bootstrap.dir}/bin/antRun"/>
  997. <delete file="${bootstrap.dir}/bin/antRun.bat"/>
  998. <delete file="${bootstrap.dir}/bin/*.pl"/>
  999. <delete file="${bootstrap.dir}/bin/*.py"/>
  1000. </target>
  1001. <!--
  1002. ===================================================================
  1003. Installs Apache Ant
  1004. ===================================================================
  1005. -->
  1006. <target name="install" if="ant.install">
  1007. <antcall inheritAll="false" target="internal_dist">
  1008. <param name="dist.dir" value="${ant.install}"/>
  1009. </antcall>
  1010. </target>
  1011. <target name="install-lite" if="ant.install">
  1012. <antcall inheritAll="false" target="dist-lite">
  1013. <param name="dist.dir" value="${ant.install}"/>
  1014. </antcall>
  1015. </target>
  1016. <!--
  1017. ===================================================================
  1018. Creates the API documentation
  1019. ===================================================================
  1020. -->
  1021. <target name="javadoc_check">
  1022. <uptodate property="javadoc.notrequired"
  1023. targetfile="${build.javadocs}/packages.html" >
  1024. <srcfiles dir= "${java.dir}" includes="**/*.java"/>
  1025. </uptodate>
  1026. <uptodate property="tests.javadoc.notrequired"
  1027. targetfile="${build.tests.javadocs}/packages.html" >
  1028. <srcfiles dir= "${tests.dir}">
  1029. <patternset refid="useful.tests"/>
  1030. </srcfiles>
  1031. </uptodate>
  1032. </target>
  1033. <target name="javadocs" depends="prepare, javadoc_check"
  1034. unless="javadoc.notrequired"
  1035. description="--> creates the API documentation">
  1036. <mkdir dir="${build.javadocs}"/>
  1037. <javadoc useexternalfile="yes"
  1038. destdir="${build.javadocs}"
  1039. author="true"
  1040. version="true"
  1041. locale="en"
  1042. windowtitle="${Name} API"
  1043. doctitle="${Name}">
  1044. <packageset dir="${java.dir}"/>
  1045. <tag name="todo" description="To do:" scope="all"/>
  1046. <tag name="ant.task" enabled="false" description="Task:" scope="types"/>
  1047. <tag name="ant.datatype" enabled="false" description="Data type:" scope="types"/>
  1048. <group title="Apache Ant Core" packages="org.apache.tools.ant*"/>
  1049. <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*"/>
  1050. <group title="Core Types" packages="org.apache.tools.ant.types*"/>
  1051. <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*"/>
  1052. <group title="Optional Types" packages="org.apache.tools.ant.types.optional*"/>
  1053. <group title="Ant Utilities" packages="org.apache.tools.ant.util*"/>
  1054. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1055. </javadoc>
  1056. </target>
  1057. <target name="test-javadocs" depends="prepare, javadoc_check"
  1058. unless="tests.javadoc.notrequired"
  1059. description="--> creates the API documentation for test utilities">
  1060. <mkdir dir="${build.tests.javadocs}"/>
  1061. <javadoc useexternalfile="yes"
  1062. destdir="${build.tests.javadocs}"
  1063. author="true"
  1064. version="true"
  1065. locale="en"
  1066. windowtitle="${Name} Test Utilities"
  1067. doctitle="${Name}">
  1068. <fileset dir="${tests.dir}">
  1069. <patternset refid="useful.tests"/>
  1070. </fileset>
  1071. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1072. </javadoc>
  1073. </target>
  1074. <!--
  1075. ===================================================================
  1076. Compile testcases
  1077. ===================================================================
  1078. -->
  1079. <target name="compile-tests" depends="build" if="junit.present">
  1080. <mkdir dir="${build.tests}"/>
  1081. <javac srcdir="${tests.dir}"
  1082. destdir="${build.tests}"
  1083. debug="${debug}"
  1084. target="${javac.target}"
  1085. deprecation="${deprecation}" >
  1086. <classpath refid="tests-classpath"/>
  1087. <patternset refid="needs.antlr"/>
  1088. <patternset refid="needs.jdk1.2+"/>
  1089. <patternset refid="needs.jdk1.3+"/>
  1090. <patternset refid="needs.jdk1.4+"/>
  1091. <patternset refid="needs.jakarta.regexp"/>
  1092. <patternset refid="needs.jakarta.oro"/>
  1093. <patternset refid="needs.jai"/>
  1094. <patternset refid="needs.trax"/>
  1095. <patternset refid="needs.xslp"/>
  1096. <patternset refid="needs.xalan1"/>
  1097. <patternset refid="needs.jakarta.bcel"/>
  1098. </javac>
  1099. </target>
  1100. <target name="dump-info" depends="dump-sys-properties,run-which"/>
  1101. <target name="dump-sys-properties" unless="which.present"
  1102. depends="xml-check">
  1103. <echo message="java.vm.info=${java.vm.info}"/>
  1104. <echo message="java.vm.name=${java.vm.name}"/>
  1105. <echo message="java.vm.vendor=${java.vm.vendor}"/>
  1106. <echo message="java.vm.version=${java.vm.version}"/>
  1107. <echo message="os.arch=${os.arch}"/>
  1108. <echo message="os.name=${os.name}"/>
  1109. <echo message="os.version=${os.version}"/>
  1110. <echo message="file.encoding=${file.encoding}"/>
  1111. <echo message="user.language=${user.language}"/>
  1112. </target>
  1113. <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
  1114. <target name="xml-check" depends="check_for_optional_packages"
  1115. if="xalan.envcheck" unless="which.present">
  1116. <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
  1117. </target>
  1118. <target name="run-which" depends="check_for_optional_packages"
  1119. if="which.present">
  1120. <java classname="org.apache.env.Which" taskname="which"/>
  1121. </target>
  1122. <!-- test to see if we are online or not. can take a while when we are off line, so
  1123. setting the property is a good shortcut-->
  1124. <target name="probe-offline">
  1125. <condition property="offline">
  1126. <or>
  1127. <isset property="offline"/>
  1128. <not>
  1129. <http url="http://www.apache.org/"/>
  1130. </not>
  1131. </or>
  1132. </condition>
  1133. <echo level="verbose" > offline=${offline}</echo>
  1134. </target>
  1135. <!--
  1136. ===================================================================
  1137. Run testcase
  1138. ===================================================================
  1139. -->
  1140. <target name="test" depends="run-tests" description="--> run JUnit tests"/>
  1141. <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present">
  1142. <condition property="run.junitreport">
  1143. <or>
  1144. <isset property="xalan2.present"/>
  1145. <and>
  1146. <isset property="xalan.present"/>
  1147. <isset property="bsf.present"/>
  1148. </and>
  1149. </or>
  1150. </condition>
  1151. <junit printsummary="${junit.summary}" haltonfailure="yes"
  1152. filtertrace="${junit.filtertrace}"
  1153. fork="${junit.fork}">
  1154. <!-- <jvmarg value="-classic"/> -->
  1155. <classpath refid="tests-classpath"/>
  1156. <classpath refid="classes.zip"/>
  1157. <sysproperty key="ant.home" value="${ant.home}"/>
  1158. <sysproperty key="build.tests" value="${build.tests}"/>
  1159. <sysproperty key="tests-classpath.value"
  1160. value="${tests-classpath.value}"/>
  1161. <formatter type="brief" usefile="false"/>
  1162. <batchtest>
  1163. <fileset dir="${tests.dir}">
  1164. <include name="**/*Test*"/>
  1165. <!-- abstract classes, not testcases -->
  1166. <exclude name="${ant.package}/taskdefs/TaskdefsTest.java"/>
  1167. <exclude name="${ant.package}/BuildFileTest.java"/>
  1168. <exclude name="${regexp.package}/RegexpMatcherTest.java"/>
  1169. <exclude name="${regexp.package}/RegexpTest.java"/>
  1170. <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java"/>
  1171. <exclude name="${ant.package}/types/AbstractFileSetTest.java"/>
  1172. <exclude name="${ant.package}/types/selectors/BaseSelectorTest.java"/>
  1173. <!-- helper classes, not testcases -->
  1174. <exclude name="org/example/**"/>
  1175. <exclude name="${ant.package}/taskdefs/TaskdefTest*Task.java"/>
  1176. <!-- interactive test -->
  1177. <exclude name="${ant.package}/taskdefs/TestProcess.java"/>
  1178. <!-- only run these tests if their required libraries are
  1179. installed -->
  1180. <patternset refid="needs.jdk1.2+"/>
  1181. <patternset refid="needs.jdk1.4+"/>
  1182. <patternset refid="needs.jakarta.regexp"/>
  1183. <patternset refid="needs.jakarta.oro"/>
  1184. <patternset refid="needs.jai"/>
  1185. <patternset refid="needs.vaj"/>
  1186. <patternset refid="needs.antlr"/>
  1187. <patternset refid="needs.xalan1"/>
  1188. <patternset refid="needs.xslp"/>
  1189. <patternset refid="needs.jakarta.bcel"/>
  1190. <patternset refid="needs.trax"/>
  1191. <!-- fails under 1.1 -->
  1192. <exclude name="${optional.package}/perforce/P4ChangeTest.java"
  1193. unless="jdk1.2+"/>
  1194. <!-- tests excluded if the test is run in offline mode -->
  1195. <patternset refid="onlinetests"/>
  1196. <!-- failing tests excluded unless run.failing.tests is set -->
  1197. <patternset refid="teststhatfail"/>
  1198. <!-- runtime dependencies that are different from compile
  1199. time dependencies -->
  1200. <exclude name="${optional.package}/ReplaceRegExpTest.java"
  1201. unless="some.regexp.support"/>
  1202. <exclude name="${optional.package}/sitraka/*.java"
  1203. unless="some.regexp.support"/>
  1204. <!-- fail if testcases can be loaded from the system classloader -->
  1205. <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  1206. if="tests.are.on.system.classpath"/>
  1207. <exclude name="${optional.package}/sitraka/XMLReportTest.java"
  1208. if="tests.are.on.system.classpath"/>
  1209. <!-- these tests need to be localised before being ran???? -->
  1210. <exclude name="${optional.package}/PvcsTest.java"/>
  1211. <!-- These tests need a TraX implementation like xalan2 or saxon -->
  1212. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1213. unless="trax.impl.present"/>
  1214. <exclude name="${optional.package}/XsltTest.java"
  1215. unless="trax.impl.present"/>
  1216. <exclude name="${ant.package}/types/XMLCatalogBuildFileTest.java"
  1217. unless="trax.impl.present"/>
  1218. <exclude name="${optional.package}/junit/JUnitReportTest.java"
  1219. unless="run.junitreport"/>
  1220. <!-- needs BSF to work -->
  1221. <exclude name="${optional.package}/XalanLiaisonTest.java"
  1222. unless="bsf.present"/>
  1223. <!--
  1224. XXX need to figure out what's causing this InvocationTargetException
  1225. -->
  1226. <exclude name="${optional.package}/junit/JUnitTestRunnerTest.java"
  1227. unless="jdk1.2+"/>
  1228. <!-- DateTime handling seems to be broken in JDK 1.1 -->
  1229. <exclude name="${util.package}/DateUtilsTest.java"
  1230. unless="jdk1.2+"/>
  1231. <exclude name="${optional.package}/JspcTest.java"/>
  1232. <!-- misc oneoff tests -->
  1233. <exclude name="${optional.package}/WsdlToDotnetTest.java"
  1234. unless="dotnetapps.found"/>
  1235. <!-- These tests only passes if testcases and Ant classes have
  1236. been loaded by the same classloader - will throw
  1237. IllegalAccessExceptions otherwise. -->
  1238. <exclude name="${ant.package}/taskdefs/SQLExecTest.java"
  1239. unless="tests.and.ant.share.classloader"/>
  1240. <exclude name="${optional.package}/sos/SOSTest.java"
  1241. unless="tests.and.ant.share.classloader"/>
  1242. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1243. unless="tests.and.ant.share.classloader"/>
  1244. <exclude name="${optional.package}/metamata/MAuditParserTest.java"
  1245. unless="tests.and.ant.share.classloader"/>
  1246. <!-- can only run if cvs is installed on your machine
  1247. enable by setting the property have.cvs
  1248. -->
  1249. <exclude name="${ant.package}/taskdefs/AbstractCvsTaskTest.java"
  1250. unless="have.cvs"/>
  1251. </fileset>
  1252. </batchtest>
  1253. <test name="org.apache.tools.ant.taskdefs.optional.JspcTest"
  1254. if="jasper.present"/>
  1255. </junit>
  1256. </target>
  1257. <target name="run-single-test" if="testcase" depends="compile-tests"
  1258. description="--> runs the single unit test defined in the testcase property">
  1259. <junit printsummary="${junit.summary}"
  1260. haltonfailure="yes"
  1261. fork="${junit.fork}"
  1262. filtertrace="${junit.filtertrace}">
  1263. <!-- <jvmarg value="-classic"/> -->
  1264. <sysproperty key="ant.home" value="${ant.home}"/>
  1265. <sysproperty key="build.tests" value="${build.tests}"/>
  1266. <sysproperty key="tests-classpath.value"
  1267. value="${tests-classpath.value}"/>
  1268. <classpath refid="classes.zip"/>
  1269. <classpath refid="tests-classpath"/>
  1270. <formatter type="plain" usefile="false"/>
  1271. <test name="${testcase}"/>
  1272. </junit>
  1273. </target>
  1274. <target name="interactive-tests" description="--> runs interactive tests"
  1275. depends="compile-tests"
  1276. if="jdk1.3+">
  1277. <java classpathref="tests-classpath"
  1278. classname="org.apache.tools.ant.taskdefs.TestProcess"
  1279. fork="true"/>
  1280. </target>
  1281. <!--
  1282. ===================================================================
  1283. Main target - runs dist-lite by default
  1284. ===================================================================
  1285. -->
  1286. <target name="main"
  1287. description="--> creates a minimum distribution in ./dist"
  1288. depends="dist-lite"/>
  1289. </project>