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

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