You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 53 kB

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