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

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