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

build.xml 61 kB

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