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

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