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

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