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

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