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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  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. </fileset>
  724. </copy>
  725. </target>
  726. <!--
  727. ===================================================================
  728. Target to create bootstrap build
  729. ===================================================================
  730. -->
  731. <target name="bootstrap" description="--> creates a bootstrap build">
  732. <antcall inheritAll="false" target="dist-lite">
  733. <param name="dist.dir" value="${bootstrap.dir}" />
  734. </antcall>
  735. </target>
  736. <!--
  737. ===================================================================
  738. Create the source distribution
  739. ===================================================================
  740. -->
  741. <target name="src-dist"
  742. description="--> creates a source distribution">
  743. <mkdir dir="${src.dist.dir}" />
  744. <copy todir="${src.dist.lib}">
  745. <fileset dir="${lib.dir}">
  746. <include name="*.jar" />
  747. <include name="*.zip" />
  748. <include name="README"/>
  749. </fileset>
  750. </copy>
  751. <copy todir="${src.dist.src}">
  752. <fileset dir="${src.dir}"/>
  753. </copy>
  754. <copy todir="${src.dist.docs}">
  755. <fileset dir="${docs.dir}">
  756. <exclude name="manual/api/**"/>
  757. </fileset>
  758. </copy>
  759. <copy todir="${src.dist.dir}">
  760. <fileset dir=".">
  761. <include name="README"/>
  762. <include name="LICENSE"/>
  763. <include name="LICENSE.crimson"/>
  764. <include name="TODO"/>
  765. <include name="WHATSNEW"/>
  766. <include name="KEYS"/>
  767. <include name="build.bat"/>
  768. <include name="build.sh"/>
  769. <include name="bootstrap.bat"/>
  770. <include name="bootstrap.sh"/>
  771. <include name="build.xml"/>
  772. </fileset>
  773. </copy>
  774. <fixcrlf srcdir="${src.dist.dir}" eol="crlf" includes="*.bat" />
  775. <fixcrlf srcdir="${src.dist.dir}" eol="lf">
  776. <include name="**/*.sh" />
  777. <include name="**/*.pl" />
  778. <include name="**/ant" />
  779. <include name="**/antRun" />
  780. </fixcrlf>
  781. <fixcrlf srcdir="${src.dist.dir}">
  782. <include name="**/*.java" />
  783. </fixcrlf>
  784. <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
  785. failonerror="${chmod.fail}" />
  786. <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}" />
  787. <chmod perm="ugo+x" failonerror="${chmod.fail}">
  788. <fileset dir="${src.dist.dir}">
  789. <include name="**/.sh" />
  790. <include name="**/.pl" />
  791. <include name="**/.py" />
  792. <include name="**/ant" />
  793. <include name="**/antRun" />
  794. </fileset>
  795. </chmod>
  796. </target>
  797. <!--
  798. ===================================================================
  799. Create the binary distribution
  800. ===================================================================
  801. -->
  802. <target name="main_distribution"
  803. description="--> creates the zip and tar distributions">
  804. <delete dir="${dist.name}" />
  805. <mkdir dir="${dist.base}"/>
  806. <mkdir dir="${dist.base}/src"/>
  807. <mkdir dir="${dist.base}/bin"/>
  808. <antcall inheritAll="false" target="internal_dist">
  809. <param name="dist.dir" value="${dist.name}" />
  810. </antcall>
  811. <zip destfile="${dist.base}/bin/${dist.name}-bin.zip"
  812. basedir="${dist.name}/.."
  813. includes="${dist.name}/**"/>
  814. <tar longfile="gnu"
  815. destfile="${dist.base}/bin/${dist.name}-bin.tar">
  816. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  817. <include name="${dist.name}/bin/ant"/>
  818. <include name="${dist.name}/bin/antRun"/>
  819. <include name="${dist.name}/bin/*.pl"/>
  820. <include name="${dist.name}/bin/*.py"/>
  821. </tarfileset>
  822. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  823. <include name="${dist.name}/**"/>
  824. <exclude name="${dist.name}/bin/ant"/>
  825. <exclude name="${dist.name}/bin/antRun"/>
  826. <include name="${dist.name}/bin/*.pl"/>
  827. <include name="${dist.name}/bin/*.py"/>
  828. </tarfileset>
  829. </tar>
  830. <gzip zipfile="${dist.base}/bin/${dist.name}-bin.tar.gz"
  831. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  832. <bzip2 zipfile="${dist.base}/bin/${dist.name}-bin.tar.bz2"
  833. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  834. <delete file="${dist.base}/bin/${dist.name}-bin.tar"/>
  835. <delete dir="${dist.name}" />
  836. <checksum fileext=".md5">
  837. <fileset dir="${dist.base}/bin/" />
  838. </checksum>
  839. <antcall inheritAll="false" target="src-dist">
  840. <param name="src.dist.dir" value="${dist.name}" />
  841. </antcall>
  842. <zip destfile="${dist.base}/src/${dist.name}-src.zip"
  843. basedir="${dist.name}/.."
  844. includes="${dist.name}/**"/>
  845. <tar longfile="gnu"
  846. destfile="${dist.base}/src/${dist.name}-src.tar" >
  847. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  848. <include name="${dist.name}/bootstrap.sh"/>
  849. <include name="${dist.name}/build.sh"/>
  850. </tarfileset>
  851. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  852. <include name="${dist.name}/**"/>
  853. <exclude name="${dist.name}/bootstrap.sh"/>
  854. <exclude name="${dist.name}/build.sh"/>
  855. </tarfileset>
  856. </tar>
  857. <gzip zipfile="${dist.base}/src/${dist.name}-src.tar.gz"
  858. src="${dist.base}/src/${dist.name}-src.tar"/>
  859. <bzip2 zipfile="${dist.base}/src/${dist.name}-src.tar.bz2"
  860. src="${dist.base}/src/${dist.name}-src.tar"/>
  861. <delete file="${dist.base}/src/${dist.name}-src.tar"/>
  862. <delete dir="${dist.name}" />
  863. <checksum fileext=".md5">
  864. <fileset dir="${dist.base}/src/" />
  865. </checksum>
  866. </target>
  867. <target name="rpm_check">
  868. <available property="rpm.present"
  869. file="/bin/rpm"/>
  870. </target>
  871. <target name="rpm" description="--> Build the RPM files for ant"
  872. depends="prepare, rpm_check"
  873. if="rpm.present">
  874. <tstamp>
  875. <format property="rpmyear" pattern="yyyyMMdd"/>
  876. <format property="nightlybuild.dir" pattern="yyyy-MM-dd"/>
  877. </tstamp>
  878. <property name="rpm.release" value="cvs${rpmyear}"/>
  879. <property name="rpm.source" value="nightly/${nightlybuild.dir}/"/>
  880. <mkdir dir="build/rpm/SPECS"/>
  881. <mkdir dir="build/rpm/SOURCES"/>
  882. <mkdir dir="build/rpm/BUILD"/>
  883. <mkdir dir="build/rpm/RPMS"/>
  884. <mkdir dir="build/rpm/SRPMS"/>
  885. <property name="disttar" location="${dist.base}/bin/${dist.name}-bin.tar.gz"/>
  886. <copy file="src/etc/ant.spec" tofile="build/rpm/SPECS/ant.spec">
  887. <filterset refid="ant.filters"/>
  888. <filterset>
  889. <filter token="RPM_RELEASE" value="${rpm.release}"/>
  890. <filter token="RPM_SOURCE" value="${rpm.source}"/>
  891. <filter token="DIST_TAR" value="${disttar}"/>
  892. </filterset>
  893. </copy>
  894. <copy file="src/etc/antsrc.spec" tofile="build/rpm/SPECS/antsrc.spec">
  895. <filterset refid="ant.filters"/>
  896. <filterset>
  897. <filter token="RPM_RELEASE" value="${rpm.release}"/>
  898. <filter token="RPM_SOURCE" value="${rpm.source}"/>
  899. </filterset>
  900. </copy>
  901. <rpm topDir="build/rpm"
  902. specfile="ant.spec"
  903. command="-bb"/>
  904. <copy file="distribution/src/${dist.name}-src.tar.gz" todir="build/rpm/SOURCES"/>
  905. <rpm topDir="build/rpm"
  906. specfile="antsrc.spec"
  907. command="-bs"/>
  908. <mkdir dir="${dist.base}/rpms"/>
  909. <copy todir="${dist.base}/rpms">
  910. <fileset dir="build/rpm/RPMS/noarch"/>
  911. </copy>
  912. <copy todir="${dist.base}/rpms">
  913. <fileset dir="build/rpm/SRPMS"/>
  914. </copy>
  915. </target>
  916. <target name="distribution" depends="main_distribution, rpm"
  917. description="--> creates the full Apache Ant distribution">
  918. </target>
  919. <!--
  920. ===================================================================
  921. Cleans up build and distribution directories
  922. ===================================================================
  923. -->
  924. <target name="clean"
  925. description="--> cleans up build and dist directories">
  926. <delete dir="${build.dir}" />
  927. <delete dir="${dist.base}" />
  928. <delete dir="${dist.dir}" />
  929. <delete>
  930. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  931. </delete>
  932. </target>
  933. <!--
  934. ===================================================================
  935. Cleans everything
  936. ===================================================================
  937. -->
  938. <target name="allclean"
  939. depends="clean"
  940. description="--> cleans up everything">
  941. <delete file="${bootstrap.dir}/bin/antRun" />
  942. <delete file="${bootstrap.dir}/bin/antRun.bat" />
  943. <delete file="${bootstrap.dir}/bin/*.pl" />
  944. <delete file="${bootstrap.dir}/bin/*.py" />
  945. </target>
  946. <!--
  947. ===================================================================
  948. Installs Apache Ant
  949. ===================================================================
  950. -->
  951. <target name="install" if="ant.install">
  952. <antcall inheritAll="false" target="internal_dist">
  953. <param name="dist.dir" value="${ant.install}" />
  954. </antcall>
  955. </target>
  956. <target name="install-lite" if="ant.install">
  957. <antcall inheritAll="false" target="dist-lite">
  958. <param name="dist.dir" value="${ant.install}" />
  959. </antcall>
  960. </target>
  961. <!--
  962. ===================================================================
  963. Creates the API documentation
  964. ===================================================================
  965. -->
  966. <target name="javadoc_check">
  967. <uptodate property="javadoc.notrequired"
  968. targetfile="${build.javadocs}/packages.html" >
  969. <srcfiles dir= "${java.dir}" includes="**/*.java"/>
  970. </uptodate>
  971. </target>
  972. <target name="javadocs" depends="prepare, javadoc_check"
  973. unless="javadoc.notrequired"
  974. description="--> creates the API documentation">
  975. <mkdir dir="${build.javadocs}"/>
  976. <javadoc packagenames="org.apache.*"
  977. useexternalfile="yes"
  978. sourcepath="${java.dir}"
  979. destdir="${build.javadocs}"
  980. author="true"
  981. version="true"
  982. locale="en"
  983. windowtitle="${Name} API"
  984. doctitle="${Name}">
  985. <tag name="todo" description="To do:" scope="all" />
  986. <tag name="ant.task" enabled="false" description="Task:" scope="types" />
  987. <tag name="ant.datatype" enabled="false" description="Data type:" scope="types" />
  988. <group title="Apache Ant Core" packages="org.apache.tools.ant*" />
  989. <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*" />
  990. <group title="Core Types" packages="org.apache.tools.ant.types*" />
  991. <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*" />
  992. <group title="Optional Types" packages="org.apache.tools.ant.types.optional*" />
  993. <group title="Ant Utilities" packages="org.apache.tools.ant.util*" />
  994. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  995. </javadoc>
  996. </target>
  997. <!--
  998. ===================================================================
  999. Compile testcases
  1000. ===================================================================
  1001. -->
  1002. <target name="compile-tests" depends="build" if="junit.present">
  1003. <mkdir dir="${build.tests}"/>
  1004. <javac srcdir="${tests.dir}"
  1005. destdir="${build.tests}"
  1006. debug="${debug}"
  1007. deprecation="${deprecation}" >
  1008. <classpath refid="tests-classpath" />
  1009. <patternset refid="needs.antlr" />
  1010. <patternset refid="needs.jdk1.2+" />
  1011. <patternset refid="needs.jdk1.3+" />
  1012. <patternset refid="needs.jdk1.4+" />
  1013. <patternset refid="needs.jakarta.regexp" />
  1014. <patternset refid="needs.jakarta.oro" />
  1015. <patternset refid="needs.trax" />
  1016. <patternset refid="needs.xslp" />
  1017. <patternset refid="needs.xalan1" />
  1018. <patternset refid="needs.jakarta.bcel" />
  1019. </javac>
  1020. </target>
  1021. <target name="dump-info" depends="dump-sys-properties,run-which" />
  1022. <target name="dump-sys-properties" unless="which.present"
  1023. depends="xml-check">
  1024. <echo message="java.vm.info=${java.vm.info}" />
  1025. <echo message="java.vm.name=${java.vm.name}" />
  1026. <echo message="java.vm.vendor=${java.vm.vendor}" />
  1027. <echo message="java.vm.version=${java.vm.version}" />
  1028. <echo message="os.arch=${os.arch}" />
  1029. <echo message="os.name=${os.name}" />
  1030. <echo message="os.version=${os.version}" />
  1031. <echo message="file.encoding=${file.encoding}" />
  1032. <echo message="user.language=${user.language}" />
  1033. </target>
  1034. <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
  1035. <target name="xml-check" depends="check_for_optional_packages"
  1036. if="xalan.envcheck" unless="which.present">
  1037. <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
  1038. </target>
  1039. <target name="run-which" depends="check_for_optional_packages"
  1040. if="which.present">
  1041. <java classname="org.apache.env.Which" taskname="which"/>
  1042. </target>
  1043. <!-- test to see if we are online or not. can take a while when we are off line, so
  1044. setting the property is a good shortcut-->
  1045. <target name="probe-offline">
  1046. <condition property="offline">
  1047. <or>
  1048. <isset property="offline"/>
  1049. <not>
  1050. <http url="http://www.apache.org/"/>
  1051. </not>
  1052. </or>
  1053. </condition>
  1054. <echo level="verbose" > offline=${offline}</echo>
  1055. </target>
  1056. <!--
  1057. ===================================================================
  1058. Run testcase
  1059. ===================================================================
  1060. -->
  1061. <target name="test" depends="run-tests" description="--> run JUnit tests"/>
  1062. <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present">
  1063. <junit printsummary="${junit.summary}" haltonfailure="yes"
  1064. filtertrace="${junit.filtertrace}"
  1065. fork="${junit.fork}">
  1066. <!-- <jvmarg value="-classic"/> -->
  1067. <classpath refid="tests-classpath"/>
  1068. <classpath refid="classes.zip" />
  1069. <sysproperty key="ant.home" value="${ant.home}" />
  1070. <sysproperty key="build.tests" value="${build.tests}"/>
  1071. <sysproperty key="tests-classpath.value"
  1072. value="${tests-classpath.value}" />
  1073. <formatter type="brief" usefile="false" />
  1074. <batchtest>
  1075. <fileset dir="${tests.dir}">
  1076. <include name="**/*Test*" />
  1077. <!-- abstract classes, not testcases -->
  1078. <exclude name="${ant.package}/taskdefs/TaskdefsTest.java" />
  1079. <exclude name="${ant.package}/BuildFileTest.java" />
  1080. <exclude name="${regexp.package}/RegexpMatcherTest.java" />
  1081. <exclude name="${regexp.package}/RegexpTest.java" />
  1082. <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java" />
  1083. <exclude name="${ant.package}/types/AbstractFileSetTest.java" />
  1084. <!-- helper classes, not testcases -->
  1085. <exclude name="org/example/**" />
  1086. <exclude name="${ant.package}/taskdefs/TaskdefTest*Task.java" />
  1087. <!-- interactive test -->
  1088. <exclude name="${ant.package}/taskdefs/TestProcess.java" />
  1089. <!-- only run these tests if their required libraries are
  1090. installed -->
  1091. <patternset refid="needs.jdk1.2+" />
  1092. <patternset refid="needs.jdk1.4+" />
  1093. <patternset refid="needs.jakarta.regexp" />
  1094. <patternset refid="needs.jakarta.oro" />
  1095. <patternset refid="needs.vaj" />
  1096. <patternset refid="needs.antlr" />
  1097. <patternset refid="needs.xalan1" />
  1098. <patternset refid="needs.xslp" />
  1099. <patternset refid="needs.jakarta.bcel" />
  1100. <patternset refid="needs.trax" />
  1101. <!-- fails under 1.1 -->
  1102. <exclude name="${optional.package}/perforce/P4ChangeTest.java"
  1103. unless="jdk1.2+"/>
  1104. <!-- tests excluded if the test is run in offline mode -->
  1105. <patternset refid="onlinetests"/>
  1106. <!-- failing tests excluded unless run.failing.tests is set -->
  1107. <patternset refid="teststhatfail" />
  1108. <!-- runtime dependencies that are different from compile
  1109. time dependencies -->
  1110. <exclude name="${optional.package}/ReplaceRegExpTest.java"
  1111. unless="some.regexp.support" />
  1112. <exclude name="${optional.package}/sitraka/*.java"
  1113. unless="some.regexp.support" />
  1114. <!-- fail if testcases can be loaded from the system classloader -->
  1115. <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  1116. if="tests.are.on.system.classpath"/>
  1117. <exclude name="${optional.package}/sitraka/XMLReportTest.java"
  1118. if="tests.are.on.system.classpath"/>
  1119. <!-- these tests need to be localised before being ran???? -->
  1120. <exclude name="${optional.package}/PvcsTest.java" />
  1121. <!-- ehm, this is not really a TraX test but rather a xalan2 test..-->
  1122. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1123. unless="xalan2.present"/>
  1124. <!-- needs BSF to work -->
  1125. <exclude name="${optional.package}/XalanLiaisonTest.java"
  1126. unless="bsf.present" />
  1127. <!--
  1128. XXX need to figure out what's causing this InvocationTargetException
  1129. -->
  1130. <exclude name="${optional.package}/junit/JUnitTestRunnerTest.java"
  1131. unless="jdk1.2+" />
  1132. <!-- DateTime handling seems to be broken in JDK 1.1 -->
  1133. <exclude name="${util.package}/DateUtilsTest.java"
  1134. unless="jdk1.2+" />
  1135. <!-- misc oneoff tests -->
  1136. <exclude name="${optional.package}/JspcTest.java"
  1137. unless="jasper.present" />
  1138. <exclude name="${optional.package}/WsdlToDotnetTest.java"
  1139. unless="dotnetapps.found" />
  1140. <!-- These tests only passes if testcases and Ant classes have
  1141. been loaded by the same classloader - will throw
  1142. IllegalAccessExceptions otherwise. -->
  1143. <exclude name="${ant.package}/taskdefs/SQLExecTest.java"
  1144. unless="tests.and.ant.share.classloader" />
  1145. <exclude name="${optional.package}/sos/SOSTest.java"
  1146. unless="tests.and.ant.share.classloader" />
  1147. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1148. unless="tests.and.ant.share.classloader" />
  1149. <exclude name="${optional.package}/metamata/MAuditParserTest.java"
  1150. unless="tests.and.ant.share.classloader" />
  1151. <!-- can only run if cvs is installed on your machine
  1152. enable by setting the property have.cvs
  1153. -->
  1154. <exclude name="${ant.package}/taskdefs/AbstractCvsTaskTest.java"
  1155. unless="have.cvs" />
  1156. </fileset>
  1157. </batchtest>
  1158. </junit>
  1159. </target>
  1160. <target name="run-single-test" if="testcase" depends="compile-tests"
  1161. description="--> runs the single unit test defined in the testcase property">
  1162. <junit printsummary="${junit.summary}"
  1163. haltonfailure="yes"
  1164. fork="${junit.fork}"
  1165. filtertrace="${junit.filtertrace}">
  1166. <!-- <jvmarg value="-classic"/> -->
  1167. <sysproperty key="ant.home" value="${ant.home}" />
  1168. <sysproperty key="build.tests" value="${build.tests}"/>
  1169. <sysproperty key="tests-classpath.value"
  1170. value="${tests-classpath.value}" />
  1171. <classpath refid="classes.zip" />
  1172. <classpath refid="tests-classpath"/>
  1173. <formatter type="plain" usefile="false" />
  1174. <test name="${testcase}" />
  1175. </junit>
  1176. </target>
  1177. <target name="interactive-tests" description="--> runs interactive tests"
  1178. depends="compile-tests"
  1179. if="jdk1.3+">
  1180. <java classpathref="tests-classpath"
  1181. classname="org.apache.tools.ant.taskdefs.TestProcess"
  1182. fork="true" />
  1183. </target>
  1184. <!--
  1185. ===================================================================
  1186. Main target - runs dist-lite by default
  1187. ===================================================================
  1188. -->
  1189. <target name="main"
  1190. description="--> creates a minimum distribution in ./dist"
  1191. depends="dist-lite" />
  1192. </project>