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

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