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

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