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

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