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

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