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

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