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

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