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

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