You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 52 kB

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