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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759
  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. <selector refid="ant.launcher"/>
  696. <manifest>
  697. <attribute name="Main-Class" value="org.apache.tools.ant.launch.Launcher"/>
  698. </manifest>
  699. </jar>
  700. <jar destfile="${build.lib}/${name}.jar"
  701. basedir="${build.classes}"
  702. manifest="${manifest}">
  703. <not>
  704. <selector id="non-core">
  705. <or>
  706. <filename name="${optional.package}/**"/>
  707. <filename name="${optional.type.package}/**"/>
  708. <filename name="${util.package}/depend/**"/>
  709. <filename name="${util.package}/optional/**"/>
  710. <selector refid="needs.apache-log4j"/>
  711. <selector refid="needs.commons-logging"/>
  712. <selector refid="needs.apache-regexp"/>
  713. <selector refid="needs.apache-oro"/>
  714. <selector refid="needs.jdk1.4+"/>
  715. <selector refid="needs.javamail"/>
  716. <selector refid="ant.launcher"/>
  717. </or>
  718. </selector>
  719. </not>
  720. <metainf dir="${build.dir}">
  721. <include name="LICENSE.txt"/>
  722. <include name="NOTICE.txt"/>
  723. </metainf>
  724. <manifest>
  725. <section name="${ant.package}/">
  726. <attribute name="Extension-name"
  727. value="org.apache.tools.ant"/>
  728. <attribute name="Specification-Title"
  729. value="Apache Ant"/>
  730. <attribute name="Specification-Version"
  731. value="${manifest-version}"/>
  732. <attribute name="Specification-Vendor"
  733. value="Apache Software Foundation"/>
  734. <attribute name="Implementation-Title"
  735. value="org.apache.tools.ant"/>
  736. <attribute name="Implementation-Version"
  737. value="${manifest-version}"/>
  738. <attribute name="Implementation-Vendor"
  739. value="Apache Software Foundation"/>
  740. </section>
  741. </manifest>
  742. <fileset dir="${docs.dir}">
  743. <include name="images/ant_logo_large.gif"/>
  744. </fileset>
  745. </jar>
  746. <jar destfile="${build.lib}/${bootstrap.jar}"
  747. basedir="${build.classes}"
  748. manifest="${manifest}">
  749. <include name="${ant.package}/Main.class"/>
  750. <metainf dir="${build.dir}">
  751. <include name="LICENSE.txt"/>
  752. <include name="NOTICE.txt"/>
  753. </metainf>
  754. <manifest>
  755. <attribute name="Class-Path"
  756. value="ant.jar xml-apis.jar xercesImpl.jar xalan.jar"/>
  757. </manifest>
  758. </jar>
  759. <jar destfile="${build.lib}/ant-nodeps.jar"
  760. basedir="${build.classes}"
  761. manifest="${manifest.tmp}">
  762. <and>
  763. <selector refid="non-core"/>
  764. <not>
  765. <or>
  766. <selector refid="needs.trax"/>
  767. <selector refid="needs.xalan1"/>
  768. <selector refid="needs.xslp"/>
  769. <selector refid="needs.apache-resolver"/>
  770. <selector refid="needs.junit"/>
  771. <selector refid="needs.apache-regexp"/>
  772. <selector refid="needs.apache-oro"/>
  773. <selector refid="needs.apache-bcel"/>
  774. <selector refid="needs.apache-log4j"/>
  775. <selector refid="needs.commons-logging"/>
  776. <selector refid="needs.apache-bsf"/>
  777. <selector refid="needs.stylebook"/>
  778. <selector refid="needs.javamail"/>
  779. <selector refid="needs.icontract"/>
  780. <selector refid="needs.netrexx"/>
  781. <selector refid="needs.weblogic.ejbc"/>
  782. <selector refid="needs.weblogic.ddcreator"/>
  783. <selector refid="needs.weblogic.server"/>
  784. <selector refid="needs.commons-net"/>
  785. <selector refid="needs.starteam"/>
  786. <selector refid="needs.vaj"/>
  787. <selector refid="needs.antlr"/>
  788. <selector refid="needs.jmf"/>
  789. <selector refid="needs.jai"/>
  790. <selector refid="needs.jdepend"/>
  791. <selector refid="needs.swing"/>
  792. <selector refid="needs.jsch"/>
  793. </or>
  794. </not>
  795. </and>
  796. <metainf dir="${build.dir}">
  797. <include name="LICENSE.txt"/>
  798. <include name="NOTICE.txt"/>
  799. </metainf>
  800. </jar>
  801. <macrodef name="optional-jar">
  802. <attribute name="dep"/>
  803. <sequential>
  804. <jar destfile="${build.lib}/${optional.jars.prefix}-@{dep}.jar"
  805. basedir="${build.classes}"
  806. manifest="${manifest.tmp}">
  807. <selector refid="needs.@{dep}"/>
  808. </jar>
  809. </sequential>
  810. </macrodef>
  811. <optional-jar dep="trax"/>
  812. <optional-jar dep="xalan1"/>
  813. <optional-jar dep="xslp"/>
  814. <optional-jar dep="apache-resolver"/>
  815. <optional-jar dep="junit"/>
  816. <optional-jar dep="apache-regexp"/>
  817. <optional-jar dep="apache-oro"/>
  818. <optional-jar dep="apache-bcel"/>
  819. <optional-jar dep="apache-log4j"/>
  820. <optional-jar dep="commons-logging"/>
  821. <optional-jar dep="apache-bsf"/>
  822. <optional-jar dep="stylebook"/>
  823. <optional-jar dep="javamail"/>
  824. <optional-jar dep="icontract"/>
  825. <optional-jar dep="netrexx"/>
  826. <optional-jar dep="commons-net"/>
  827. <optional-jar dep="starteam"/>
  828. <optional-jar dep="vaj"/>
  829. <optional-jar dep="antlr"/>
  830. <optional-jar dep="jmf"/>
  831. <optional-jar dep="jai"/>
  832. <optional-jar dep="swing"/>
  833. <optional-jar dep="jsch"/>
  834. <optional-jar dep="jdepend"/>
  835. <jar destfile="${build.lib}/${optional.jars.prefix}-weblogic.jar"
  836. basedir="${build.classes}"
  837. manifest="${manifest.tmp}">
  838. <or>
  839. <selector refid="needs.weblogic.ejbc"/>
  840. <selector refid="needs.weblogic.ddcreator"/>
  841. <selector refid="needs.weblogic.server"/>
  842. </or>
  843. </jar>
  844. </target>
  845. <!-- Creates jar of test utility classes -->
  846. <target name="test-jar"
  847. depends="compile-tests"
  848. description="--> creates the Apache Ant Test Utilties jar">
  849. <fail unless="junit.present">
  850. We cannot build the test jar unless JUnit is present,
  851. as JUnit is needed to compile the test classes.
  852. </fail>
  853. <jar destfile="${build.lib}/${name}-testutil.jar"
  854. basedir="${build.tests}">
  855. <patternset refid="useful.tests"/>
  856. </jar>
  857. </target>
  858. <!--
  859. ===================================================================
  860. Create the essential distribution that can run Apache Ant
  861. ===================================================================
  862. -->
  863. <target name="dist-lite"
  864. depends="jars"
  865. description="--> creates a minimum distribution to run Apache Ant">
  866. <mkdir dir="${dist.dir}"/>
  867. <mkdir dir="${dist.bin}"/>
  868. <mkdir dir="${dist.lib}"/>
  869. <copy todir="${dist.lib}">
  870. <fileset dir="${build.lib}">
  871. <exclude name="${bootstrap.jar}"/>
  872. </fileset>
  873. </copy>
  874. <copy todir="${dist.lib}">
  875. <fileset dir="${lib.dir}">
  876. <include name="*.jar"/>
  877. <include name="*.zip"/>
  878. </fileset>
  879. </copy>
  880. <copy todir="${dist.bin}">
  881. <fileset dir="${script.dir}/"/>
  882. </copy>
  883. <fixcrlf srcdir="${dist.bin}" eol="dos" includes="*.bat,*.cmd"/>
  884. <fixcrlf srcdir="${dist.bin}" eol="unix">
  885. <include name="ant"/>
  886. <include name="antRun"/>
  887. <include name="*.pl"/>
  888. </fixcrlf>
  889. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  890. failonerror="${chmod.fail}"/>
  891. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  892. failonerror="${chmod.fail}" maxparallel="${chmod.maxparallel}"/>
  893. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  894. <fileset dir="${dist.bin}">
  895. <include name="**/ant"/>
  896. <include name="**/antRun"/>
  897. <include name="**/*.pl"/>
  898. <include name="**/*.py"/>
  899. </fileset>
  900. </chmod>
  901. </target>
  902. <!--
  903. ===================================================================
  904. Create the complete distribution
  905. ===================================================================
  906. -->
  907. <target name="dist" description="--> creates a complete distribution">
  908. <antcall inheritAll="false" target="internal_dist">
  909. <param name="dist.dir" value="${dist.name}"/>
  910. </antcall>
  911. </target>
  912. <target name="dist_javadocs" depends="javadocs">
  913. <mkdir dir="${dist.javadocs}"/>
  914. <copy todir="${dist.javadocs}" overwrite="true">
  915. <fileset dir="${build.javadocs}"/>
  916. </copy>
  917. </target>
  918. <target name="internal_dist" depends="dist-lite,dist_javadocs">
  919. <mkdir dir="${dist.docs}"/>
  920. <mkdir dir="${dist.etc}"/>
  921. <copy todir="${dist.lib}" file="${lib.dir}/README"/>
  922. <copy todir="${dist.docs}">
  923. <fileset dir="${docs.dir}" excludes="${unfiltered.files}">
  924. <patternset refid="site.excludes"/>
  925. </fileset>
  926. <filterchain refid="ant.filters"/>
  927. </copy>
  928. <copy todir="${dist.docs}" filtering="false">
  929. <fileset dir="${docs.dir}" includes="${unfiltered.files}">
  930. <patternset refid="site.excludes"/>
  931. </fileset>
  932. </copy>
  933. <copy todir="${dist.dir}">
  934. <fileset dir=".">
  935. <include name="README"/>
  936. <include name="INSTALL"/>
  937. <include name="LICENSE"/>
  938. <include name="LICENSE.xerces"/>
  939. <include name="LICENSE.dom"/>
  940. <include name="LICENSE.sax"/>
  941. <include name="NOTICE"/>
  942. <include name="TODO"/>
  943. <include name="WHATSNEW"/>
  944. <include name="KEYS"/>
  945. <include name="welcome.html"/>
  946. </fileset>
  947. </copy>
  948. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  949. failonerror="${chmod.fail}"/>
  950. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  951. failonerror="${chmod.fail}" maxparallel="${chmod.maxparallel}"/>
  952. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  953. <fileset dir="${dist.bin}">
  954. <include name="**/ant"/>
  955. <include name="**/antRun"/>
  956. <include name="**/*.pl"/>
  957. <include name="**/*.py"/>
  958. </fileset>
  959. </chmod>
  960. <!-- publish some useful stylesheets -->
  961. <copy todir="${dist.etc}">
  962. <fileset dir="${etc.dir}">
  963. <include name="junit-frames.xsl"/>
  964. <include name="junit-noframes.xsl"/>
  965. <include name="junit-frames-xalan1.xsl"/>
  966. <include name="coverage-frames.xsl"/>
  967. <include name="maudit-frames.xsl"/>
  968. <include name="mmetrics-frames.xsl"/>
  969. <include name="changelog.xsl"/>
  970. <include name="jdepend.xsl"/>
  971. <include name="jdepend-frames.xsl"/>
  972. <include name="checkstyle/*.xsl"/>
  973. <include name="log.xsl"/>
  974. <include name="tagdiff.xsl"/>
  975. </fileset>
  976. <fileset dir="${build.lib}">
  977. <include name="${bootstrap.jar}"/>
  978. </fileset>
  979. </copy>
  980. </target>
  981. <!--
  982. ===================================================================
  983. Target to create bootstrap build
  984. ===================================================================
  985. -->
  986. <target name="bootstrap" description="--> creates a bootstrap build">
  987. <antcall inheritAll="false" target="dist-lite">
  988. <param name="dist.dir" value="${bootstrap.dir}"/>
  989. </antcall>
  990. </target>
  991. <!--
  992. ===================================================================
  993. Create the source distribution
  994. ===================================================================
  995. -->
  996. <target name="src-dist"
  997. description="--> creates a source distribution">
  998. <mkdir dir="${src.dist.dir}"/>
  999. <copy todir="${src.dist.lib}">
  1000. <fileset dir="${lib.dir}">
  1001. <include name="*.jar"/>
  1002. <include name="*.zip"/>
  1003. <include name="README"/>
  1004. </fileset>
  1005. </copy>
  1006. <copy todir="${src.dist.src}">
  1007. <fileset dir="${src.dir}"/>
  1008. </copy>
  1009. <copy todir="${src.dist.docs}">
  1010. <fileset dir="${docs.dir}">
  1011. <exclude name="manual/api/**"/>
  1012. <patternset refid="site.excludes"/>
  1013. </fileset>
  1014. </copy>
  1015. <copy todir="${src.dist.dir}">
  1016. <fileset dir=".">
  1017. <include name="README"/>
  1018. <include name="INSTALL"/>
  1019. <include name="LICENSE"/>
  1020. <include name="LICENSE.xerces"/>
  1021. <include name="LICENSE.dom"/>
  1022. <include name="LICENSE.sax"/>
  1023. <include name="NOTICE"/>
  1024. <include name="TODO"/>
  1025. <include name="WHATSNEW"/>
  1026. <include name="KEYS"/>
  1027. <include name="build.bat"/>
  1028. <include name="build.sh"/>
  1029. <include name="bootstrap.bat"/>
  1030. <include name="bootstrap.sh"/>
  1031. <include name="build.xml"/>
  1032. <include name="welcome.html"/>
  1033. </fileset>
  1034. </copy>
  1035. <fixcrlf srcdir="${src.dist.dir}" eol="dos" includes="*.bat,*.cmd"/>
  1036. <fixcrlf srcdir="${src.dist.dir}" eol="unix">
  1037. <include name="**/*.sh"/>
  1038. <include name="**/*.pl"/>
  1039. <include name="**/ant"/>
  1040. <include name="**/antRun"/>
  1041. </fixcrlf>
  1042. <fixcrlf srcdir="${src.dist.dir}">
  1043. <include name="**/*.java"/>
  1044. <exclude name="src/etc/testcases/taskdefs/fixcrlf/expected/Junk?.java"/>
  1045. <exclude name="src/etc/testcases/taskdefs/fixcrlf/input/Junk?.java"/>
  1046. </fixcrlf>
  1047. <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
  1048. failonerror="${chmod.fail}"/>
  1049. <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}"/>
  1050. <chmod perm="ugo+x" failonerror="${chmod.fail}">
  1051. <fileset dir="${src.dist.dir}">
  1052. <include name="**/.sh"/>
  1053. <include name="**/.pl"/>
  1054. <include name="**/.py"/>
  1055. <include name="**/ant"/>
  1056. <include name="**/antRun"/>
  1057. </fileset>
  1058. </chmod>
  1059. </target>
  1060. <!--
  1061. ===================================================================
  1062. Create the binary distribution
  1063. ===================================================================
  1064. -->
  1065. <target name="main_distribution"
  1066. description="--> creates the zip and tar distributions">
  1067. <delete dir="${dist.name}"/>
  1068. <delete dir="${java-repository.dir}"/>
  1069. <mkdir dir="${dist.base}"/>
  1070. <mkdir dir="${dist.base.source}"/>
  1071. <mkdir dir="${dist.base.binaries}"/>
  1072. <mkdir dir="${java-repository.dir}"/>
  1073. <antcall inheritAll="false" target="internal_dist">
  1074. <param name="dist.dir" value="${dist.name}"/>
  1075. </antcall>
  1076. <zip destfile="${dist.base.binaries}/${dist.name}-bin.zip">
  1077. <zipfileset dir="${dist.name}/.." filemode="755">
  1078. <include name="${dist.name}/bin/ant"/>
  1079. <include name="${dist.name}/bin/antRun"/>
  1080. <include name="${dist.name}/bin/*.pl"/>
  1081. <include name="${dist.name}/bin/*.py"/>
  1082. </zipfileset>
  1083. <fileset dir="${dist.name}/..">
  1084. <include name="${dist.name}/**"/>
  1085. <exclude name="${dist.name}/bin/ant"/>
  1086. <exclude name="${dist.name}/bin/antRun"/>
  1087. <exclude name="${dist.name}/bin/*.pl"/>
  1088. <exclude name="${dist.name}/bin/*.py"/>
  1089. </fileset>
  1090. </zip>
  1091. <tar longfile="gnu"
  1092. destfile="${dist.base.binaries}/${dist.name}-bin.tar">
  1093. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  1094. <include name="${dist.name}/bin/ant"/>
  1095. <include name="${dist.name}/bin/antRun"/>
  1096. <include name="${dist.name}/bin/*.pl"/>
  1097. <include name="${dist.name}/bin/*.py"/>
  1098. </tarfileset>
  1099. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  1100. <include name="${dist.name}/**"/>
  1101. <exclude name="${dist.name}/bin/ant"/>
  1102. <exclude name="${dist.name}/bin/antRun"/>
  1103. <exclude name="${dist.name}/bin/*.pl"/>
  1104. <exclude name="${dist.name}/bin/*.py"/>
  1105. </tarfileset>
  1106. </tar>
  1107. <gzip destfile="${dist.base.binaries}/${dist.name}-bin.tar.gz"
  1108. src="${dist.base.binaries}/${dist.name}-bin.tar"/>
  1109. <bzip2 destfile="${dist.base.binaries}/${dist.name}-bin.tar.bz2"
  1110. src="${dist.base.binaries}/${dist.name}-bin.tar"/>
  1111. <delete file="${dist.base.binaries}/${dist.name}-bin.tar"/>
  1112. <copy todir="${java-repository.dir}">
  1113. <fileset dir="${dist.name}/lib">
  1114. <include name="ant*.jar"/>
  1115. </fileset>
  1116. <mapper type="glob" from="*.jar" to="*-${version}.jar"/>
  1117. </copy>
  1118. <checksum fileext=".md5">
  1119. <fileset dir="${java-repository.dir}" includes="*${version}.jar"/>
  1120. </checksum>
  1121. <checksum fileext=".sha1" algorithm="SHA">
  1122. <fileset dir="${java-repository.dir}" includes="*${version}.jar"/>
  1123. </checksum>
  1124. <delete dir="${dist.name}"/>
  1125. <checksum fileext=".md5">
  1126. <fileset dir="${dist.base.binaries}/">
  1127. <include name="**/*"/>
  1128. <exclude name="**/*.asc"/>
  1129. <exclude name="**/*.md5"/>
  1130. </fileset>
  1131. </checksum>
  1132. <checksum fileext=".sha1" algorithm="SHA">
  1133. <fileset dir="${dist.base.binaries}/">
  1134. <include name="**/*"/>
  1135. <exclude name="**/*.asc"/>
  1136. <exclude name="**/*.md5"/>
  1137. </fileset>
  1138. </checksum>
  1139. <antcall inheritAll="false" target="src-dist">
  1140. <param name="src.dist.dir" value="${dist.name}"/>
  1141. </antcall>
  1142. <zip destfile="${dist.base.source}/${dist.name}-src.zip">
  1143. <zipfileset dir="${dist.name}/.." filemode="755">
  1144. <include name="${dist.name}/bootstrap.sh"/>
  1145. <include name="${dist.name}/build.sh"/>
  1146. </zipfileset>
  1147. <fileset dir="${dist.name}/..">
  1148. <include name="${dist.name}/**"/>
  1149. <exclude name="${dist.name}/bootstrap.sh"/>
  1150. <exclude name="${dist.name}/build.sh"/>
  1151. </fileset>
  1152. </zip>
  1153. <tar longfile="gnu"
  1154. destfile="${dist.base.source}/${dist.name}-src.tar">
  1155. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  1156. <include name="${dist.name}/bootstrap.sh"/>
  1157. <include name="${dist.name}/build.sh"/>
  1158. </tarfileset>
  1159. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  1160. <include name="${dist.name}/**"/>
  1161. <exclude name="${dist.name}/bootstrap.sh"/>
  1162. <exclude name="${dist.name}/build.sh"/>
  1163. </tarfileset>
  1164. </tar>
  1165. <gzip destfile="${dist.base.source}/${dist.name}-src.tar.gz"
  1166. src="${dist.base.source}/${dist.name}-src.tar"/>
  1167. <bzip2 destfile="${dist.base.source}/${dist.name}-src.tar.bz2"
  1168. src="${dist.base.source}/${dist.name}-src.tar"/>
  1169. <delete file="${dist.base.source}/${dist.name}-src.tar"/>
  1170. <delete dir="${dist.name}"/>
  1171. <checksum fileext=".md5">
  1172. <fileset dir="${dist.base.source}/">
  1173. <include name="**/*"/>
  1174. <exclude name="**/*.asc"/>
  1175. <exclude name="**/*.md5"/>
  1176. </fileset>
  1177. </checksum>
  1178. <checksum fileext=".sha1" algorithm="SHA">
  1179. <fileset dir="${dist.base.source}/">
  1180. <include name="**/*"/>
  1181. <exclude name="**/*.asc"/>
  1182. <exclude name="**/*.md5"/>
  1183. </fileset>
  1184. </checksum>
  1185. </target>
  1186. <target name="distribution" depends="main_distribution"
  1187. description="--> creates the full Apache Ant distribution">
  1188. </target>
  1189. <!--
  1190. ===================================================================
  1191. Upload the distribution to cvs.apache.org for final releases
  1192. ===================================================================
  1193. -->
  1194. <target name="upload" description="upload distribution">
  1195. <fail unless="apache.user" message="set a property apache.user with your apache user"/>
  1196. <fail unless="ssh.passphrase" message="set a property with your ssh passphrase"/>
  1197. <fail unless="ssh.keyfile" message="set a property with your ssh keyfile"/>
  1198. <fail unless="ssh.knownhosts" message="set a property with your ssh knownhosts"/>
  1199. <scp todir="${apache.user}@cvs.apache.org:/www/www.apache.org/dist/ant" keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}" knownhosts="${ssh.knownhosts}">
  1200. <fileset dir="${dist.base}">
  1201. <include name="**/*${version}*"/>
  1202. </fileset>
  1203. </scp>
  1204. <scp todir="${apache.user}@cvs.apache.org:/www/www.apache.org/dist/java-repository/ant/jars" keyfile="${ssh.keyfile}" passphrase="${ssh.passphrase}" knownhosts="${ssh.knownhosts}">
  1205. <fileset dir="java-repository/ant/jars">
  1206. <include name="*${version}*"/>
  1207. </fileset>
  1208. </scp>
  1209. </target>
  1210. <!--
  1211. ===================================================================
  1212. Cleans up build and distribution directories
  1213. ===================================================================
  1214. -->
  1215. <target name="clean"
  1216. description="--> cleans up build and dist directories">
  1217. <delete dir="${build.dir}"/>
  1218. <delete dir="${dist.base}"/>
  1219. <delete dir="${dist.dir}"/>
  1220. <delete>
  1221. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  1222. </delete>
  1223. </target>
  1224. <!--
  1225. ===================================================================
  1226. Cleans everything
  1227. ===================================================================
  1228. -->
  1229. <target name="allclean"
  1230. depends="clean"
  1231. description="--> cleans up everything">
  1232. <delete file="${bootstrap.dir}/bin/antRun"/>
  1233. <delete file="${bootstrap.dir}/bin/antRun.bat"/>
  1234. <delete file="${bootstrap.dir}/bin/*.pl"/>
  1235. <delete file="${bootstrap.dir}/bin/*.py"/>
  1236. </target>
  1237. <!--
  1238. ===================================================================
  1239. Installs Apache Ant
  1240. ===================================================================
  1241. -->
  1242. <target name="install" if="ant.install">
  1243. <antcall inheritAll="false" target="internal_dist">
  1244. <param name="dist.dir" value="${ant.install}"/>
  1245. </antcall>
  1246. </target>
  1247. <target name="install-lite" if="ant.install">
  1248. <antcall inheritAll="false" target="dist-lite">
  1249. <param name="dist.dir" value="${ant.install}"/>
  1250. </antcall>
  1251. </target>
  1252. <!--
  1253. ===================================================================
  1254. Creates the API documentation
  1255. ===================================================================
  1256. -->
  1257. <target name="javadoc_check">
  1258. <uptodate property="javadoc.notrequired"
  1259. targetfile="${build.javadocs}/packages.html">
  1260. <srcfiles dir="${java.dir}" includes="**/*.java"/>
  1261. </uptodate>
  1262. <uptodate property="tests.javadoc.notrequired"
  1263. targetfile="${build.tests.javadocs}/packages.html">
  1264. <srcfiles dir="${tests.dir}">
  1265. <patternset refid="useful.tests"/>
  1266. </srcfiles>
  1267. </uptodate>
  1268. </target>
  1269. <target name="javadocs" depends="prepare, javadoc_check"
  1270. unless="javadoc.notrequired"
  1271. description="--> creates the API documentation">
  1272. <mkdir dir="${build.javadocs}"/>
  1273. <javadoc useexternalfile="yes"
  1274. destdir="${build.javadocs}"
  1275. author="true"
  1276. version="true"
  1277. locale="en"
  1278. windowtitle="${Name} API"
  1279. doctitle="${Name}">
  1280. <packageset dir="${java.dir}"/>
  1281. <tag name="todo" description="To do:" scope="all"/>
  1282. <tag name="ant.task" enabled="false" description="Task:" scope="types"/>
  1283. <tag name="ant.datatype" enabled="false" description="Data type:" scope="types"/>
  1284. <tag name="ant.attribute" enabled="false" description="Attribute:" scope="types"/>
  1285. <tag name="ant.attribute.group" enabled="false" description="Attribute group:" scope="types"/>
  1286. <tag name="ant.element" enabled="false" description="Nested element:" scope="types"/>
  1287. <group title="Apache Ant Core" packages="org.apache.tools.ant*"/>
  1288. <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*"/>
  1289. <group title="Core Types" packages="org.apache.tools.ant.types*"/>
  1290. <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*"/>
  1291. <group title="Optional Types" packages="org.apache.tools.ant.types.optional*"/>
  1292. <group title="Ant Utilities" packages="org.apache.tools.ant.util*"/>
  1293. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1294. </javadoc>
  1295. </target>
  1296. <target name="test-javadocs" depends="prepare, javadoc_check"
  1297. unless="tests.javadoc.notrequired"
  1298. description="--> creates the API documentation for test utilities">
  1299. <mkdir dir="${build.tests.javadocs}"/>
  1300. <javadoc useexternalfile="yes"
  1301. destdir="${build.tests.javadocs}"
  1302. author="true"
  1303. version="true"
  1304. locale="en"
  1305. windowtitle="${Name} Test Utilities"
  1306. doctitle="${Name}">
  1307. <fileset dir="${tests.dir}">
  1308. <patternset refid="useful.tests"/>
  1309. </fileset>
  1310. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1311. </javadoc>
  1312. </target>
  1313. <!--
  1314. ===================================================================
  1315. Compile testcases
  1316. ===================================================================
  1317. -->
  1318. <target name="compile-tests" depends="build" if="junit.present">
  1319. <mkdir dir="${build.tests}"/>
  1320. <javac srcdir="${tests.dir}"
  1321. destdir="${build.tests}"
  1322. debug="${debug}"
  1323. target="${javac.target}"
  1324. source="${javac.source}"
  1325. deprecation="${deprecation}">
  1326. <classpath refid="tests-classpath"/>
  1327. <selector refid="conditional-patterns"/>
  1328. </javac>
  1329. <!-- Used by AntlibTest.testAntlibResource: -->
  1330. <jar jarfile="${build.tests}/org/apache/tools/ant/taskdefs/test2-antlib.jar">
  1331. <zipfileset dir="${tests.etc.dir}" fullpath="taskdefs/test.antlib.xml">
  1332. <include name="taskdefs/test2.antlib.xml"/>
  1333. </zipfileset>
  1334. </jar>
  1335. </target>
  1336. <target name="dump-info" depends="dump-sys-properties,run-which"/>
  1337. <target name="dump-sys-properties" unless="which.present"
  1338. depends="xml-check">
  1339. <echo message="java.vm.info=${java.vm.info}"/>
  1340. <echo message="java.vm.name=${java.vm.name}"/>
  1341. <echo message="java.vm.vendor=${java.vm.vendor}"/>
  1342. <echo message="java.vm.version=${java.vm.version}"/>
  1343. <echo message="os.arch=${os.arch}"/>
  1344. <echo message="os.name=${os.name}"/>
  1345. <echo message="os.version=${os.version}"/>
  1346. <echo message="file.encoding=${file.encoding}"/>
  1347. <echo message="user.language=${user.language}"/>
  1348. </target>
  1349. <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
  1350. <target name="xml-check" depends="check_for_optional_packages"
  1351. if="xalan.envcheck" unless="which.present">
  1352. <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
  1353. </target>
  1354. <target name="run-which" depends="check_for_optional_packages"
  1355. if="which.present">
  1356. <java classname="org.apache.env.Which" taskname="which"/>
  1357. </target>
  1358. <!-- test to see if we are online or not. can take a while when we are off line, so
  1359. setting the property is a good shortcut-->
  1360. <target name="probe-offline">
  1361. <condition property="offline">
  1362. <or>
  1363. <isset property="offline"/>
  1364. <not>
  1365. <http url="http://www.apache.org/"/>
  1366. </not>
  1367. </or>
  1368. </condition>
  1369. <echo level="verbose"> offline=${offline}</echo>
  1370. </target>
  1371. <!--
  1372. ===================================================================
  1373. Run testcase
  1374. ===================================================================
  1375. -->
  1376. <target name="test" depends="run-tests,run-single-test" description="--> run JUnit tests"/>
  1377. <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present" unless="testcase">
  1378. <condition property="run.junitreport">
  1379. <or>
  1380. <isset property="xalan2.present"/>
  1381. <and>
  1382. <isset property="xalan.present"/>
  1383. <isset property="bsf.present"/>
  1384. </and>
  1385. </or>
  1386. </condition>
  1387. <property name="includetests" value="**/*Test*" />
  1388. <property name="excludetests" value="" />
  1389. <junit printsummary="${junit.summary}" haltonfailure="${test.haltonfailure}"
  1390. filtertrace="${junit.filtertrace}"
  1391. fork="${junit.fork}" forkmode="${junit.forkmode}"
  1392. failureproperty="tests.failed">
  1393. <!-- <jvmarg value="-classic"/> -->
  1394. <classpath refid="tests-classpath"/>
  1395. <sysproperty key="ant.home" value="${ant.home}"/>
  1396. <sysproperty key="build.tests" file="${build.tests}"/>
  1397. <sysproperty key="offline" value="${offline}"/>
  1398. <sysproperty key="build.tests.value" value="${build.tests.value}"/>
  1399. <sysproperty key="tests-classpath.value"
  1400. value="${tests-classpath.value}"/>
  1401. <sysproperty key="root" file="${basedir}"/>
  1402. <sysproperty key="build.compiler" value="${build.compiler}"/>
  1403. <formatter type="brief" usefile="false"/>
  1404. <batchtest>
  1405. <fileset dir="${tests.dir}"
  1406. includes="${includetests}" excludes="${excludetests}">
  1407. <!-- abstract classes, not testcases -->
  1408. <exclude name="${taskdefs.package}/TaskdefsTest.java"/>
  1409. <exclude name="${ant.package}/BuildFileTest.java"/>
  1410. <exclude name="${regexp.package}/RegexpMatcherTest.java"/>
  1411. <exclude name="${regexp.package}/RegexpTest.java"/>
  1412. <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java"/>
  1413. <exclude name="${ant.package}/types/AbstractFileSetTest.java"/>
  1414. <exclude name="${ant.package}/types/selectors/BaseSelectorTest.java"/>
  1415. <!-- helper classes, not testcases -->
  1416. <exclude name="org/example/**"/>
  1417. <exclude name="${taskdefs.package}/TaskdefTest*Task.java"/>
  1418. <exclude name="${optional.package}/junit/TestFormatter.java"/>
  1419. <!-- interactive tests -->
  1420. <exclude name="${taskdefs.package}/TestProcess.java"/>
  1421. <exclude name="${optional.package}/splash/SplashScreenTest.java"/>
  1422. <!-- only run these tests if their required libraries are
  1423. installed -->
  1424. <selector refid="conditional-patterns"/>
  1425. <!-- tests excluded if the test is run in offline mode -->
  1426. <patternset refid="onlinetests"/>
  1427. <!-- failing tests excluded unless run.failing.tests is set -->
  1428. <patternset refid="teststhatfail"/>
  1429. <!-- runtime dependencies that are different from compile
  1430. time dependencies -->
  1431. <exclude name="${optional.package}/ReplaceRegExpTest.java"
  1432. unless="some.regexp.support"/>
  1433. <exclude name="${optional.package}/sitraka/*.java"
  1434. unless="some.regexp.support"/>
  1435. <exclude name="${ant.package}/types/selectors/ContainsRegexpTest.java"
  1436. unless="some.regexp.support"/>
  1437. <exclude name="${ant.package}/types/mappers/RegexpPatternMapperTest.java"
  1438. unless="some.regexp.support"/>
  1439. <exclude name="${optional.package}/Rhino*.java"
  1440. unless="bsf.present"/>
  1441. <exclude name="${optional.package}/Rhino*.java"
  1442. unless="rhino.present"/>
  1443. <exclude name="${optional.package}/script/*.java"
  1444. unless="bsf.present"/>
  1445. <exclude name="${optional.package}/script/*.java"
  1446. unless="rhino.present"/>
  1447. <exclude name="${optional.package}/BeanShellScriptTest.java"
  1448. unless="bsf.present"/>
  1449. <exclude name="${optional.package}/BeanShellScriptTest.java"
  1450. unless="beanshell.present"/>
  1451. <exclude name="${optional.type.package}/Script*.java"
  1452. unless="bsf.present"/>
  1453. <exclude name="${optional.type.package}/Script*.java"
  1454. unless="rhino.present"/>
  1455. <!-- fail if testcases can be loaded from the system classloader -->
  1456. <exclude name="${ant.package}/AntClassLoaderDelegationTest.java"
  1457. if="tests.are.on.system.classpath"/>
  1458. <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  1459. if="tests.are.on.system.classpath"/>
  1460. <exclude name="${optional.package}/sitraka/XMLReportTest.java"
  1461. if="tests.are.on.system.classpath"/>
  1462. <!-- these tests need to be localised before being ran???? -->
  1463. <exclude name="${optional.package}/PvcsTest.java"/>
  1464. <!-- These tests need a TraX implementation like xalan2 or saxon -->
  1465. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1466. unless="trax.impl.present"/>
  1467. <exclude name="${optional.package}/XsltTest.java"
  1468. unless="trax.impl.present"/>
  1469. <exclude name="${ant.package}/types/XMLCatalogBuildFileTest.java"
  1470. unless="trax.impl.present"/>
  1471. <exclude name="${optional.package}/junit/JUnitReportTest.java"
  1472. unless="run.junitreport"/>
  1473. <exclude name="${taskdefs.package}/StyleTest.java"
  1474. unless="trax.impl.present"/>
  1475. <!-- needs BSF to work -->
  1476. <exclude name="${optional.package}/XalanLiaisonTest.java"
  1477. unless="bsf.present"/>
  1478. <exclude name="${optional.package}/XalanLiaisonTest.java"
  1479. unless="xerces1.present"/>
  1480. <exclude name="${optional.package}/XslpLiaisonTest.java"
  1481. unless="xerces1.present"/>
  1482. <!-- needs resolver.jar to work -->
  1483. <exclude name="${optional.package}/XmlValidateCatalogTest.java"
  1484. unless="apache.resolver.present"/>
  1485. <!-- needs jasperc -->
  1486. <exclude name="${optional.package}/JspcTest.java"
  1487. unless="jasper.present"/>
  1488. <!-- misc oneoff tests -->
  1489. <exclude name="${optional.package}/WsdlToDotnetTest.java"
  1490. unless="dotnetapps.found"/>
  1491. <exclude name="${optional.package}/DotnetTest.java"
  1492. unless="dotnetapps.found"/>
  1493. <!-- These tests only passes if testcases and Ant classes have
  1494. been loaded by the same classloader - will throw
  1495. IllegalAccessExceptions otherwise. -->
  1496. <exclude name="${ant.package}/DirectoryScannerTest.java"
  1497. unless="tests.and.ant.share.classloader"/>
  1498. <exclude name="${taskdefs.package}/SQLExecTest.java"
  1499. unless="tests.and.ant.share.classloader"/>
  1500. <exclude name="${taskdefs.package}/cvslib/ChangeLogWriterTest.java"
  1501. unless="tests.and.ant.share.classloader"/>
  1502. <exclude name="${optional.package}/sos/SOSTest.java"
  1503. unless="tests.and.ant.share.classloader"/>
  1504. <exclude name="${optional.package}/vss/MSVSSTest.java"
  1505. unless="tests.and.ant.share.classloader"/>
  1506. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1507. unless="tests.and.ant.share.classloader"/>
  1508. <exclude name="${optional.package}/metamata/MAuditParserTest.java"
  1509. unless="tests.and.ant.share.classloader"/>
  1510. <exclude name="${taskdefs.package}/ProcessDestroyerTest.java"
  1511. unless="tests.and.ant.share.classloader"/>
  1512. <exclude name="${taskdefs.package}/ProtectedJarMethodsTest.java"
  1513. unless="tests.and.ant.share.classloader"/>
  1514. <!-- can only run if cvs is installed on your machine
  1515. enable by setting the property have.cvs
  1516. -->
  1517. <exclude name="${taskdefs.package}/AbstractCvsTaskTest.java"
  1518. unless="have.cvs"/>
  1519. <!-- needs a local ftp server and the entry of a user/password combination -->
  1520. <exclude name="${optional.package}/net/FTPTest.java"/>
  1521. <!-- test needs special setup -->
  1522. <exclude name="${optional.package}/ssh/ScpTest.java"/>
  1523. <!-- test fails if build/classes and ant.jar are using the same
  1524. classloader -->
  1525. <exclude name="${ant.package}/util/ClasspathUtilsTest.java"
  1526. if="tests.and.ant.share.classloader"/>
  1527. </fileset>
  1528. </batchtest>
  1529. </junit>
  1530. <fail if="tests.failed">At least one test has failed.</fail>
  1531. </target>
  1532. <target name="run-single-test" if="testcase" depends="compile-tests,run-single-test-only"
  1533. description="--> runs the single unit test defined in the testcase property"/>
  1534. <target name="run-single-test-only" if="testcase"
  1535. description="--> runs the single unit test defined in the testcase property">
  1536. <junit printsummary="${junit.summary}"
  1537. haltonfailure="${test.haltonfailure}"
  1538. fork="${junit.fork}"
  1539. filtertrace="${junit.filtertrace}">
  1540. <!-- <jvmarg value="-classic"/> -->
  1541. <sysproperty key="ant.home" value="${ant.home}"/>
  1542. <sysproperty key="build.tests" file="${build.tests}"/>
  1543. <sysproperty key="build.tests.value" value="${build.tests.value}"/>
  1544. <sysproperty key="offline" value="${offline}"/>
  1545. <sysproperty key="tests-classpath.value"
  1546. value="${tests-classpath.value}"/>
  1547. <sysproperty key="root" file="${basedir}"/>
  1548. <sysproperty key="build.compiler" value="${build.compiler}"/>
  1549. <classpath refid="tests-classpath"/>
  1550. <formatter type="plain" usefile="false"/>
  1551. <test name="${testcase}"/>
  1552. </junit>
  1553. </target>
  1554. <target name="interactive-tests" description="--> runs interactive tests"
  1555. depends="compile-tests"
  1556. if="jdk1.3+">
  1557. <java classpathref="tests-classpath"
  1558. classname="org.apache.tools.ant.taskdefs.TestProcess"
  1559. fork="true"/>
  1560. </target>
  1561. <!--
  1562. ===================================================================
  1563. Main target - runs dist-lite by default
  1564. ===================================================================
  1565. -->
  1566. <target name="main"
  1567. description="--> creates a minimum distribution in ./dist"
  1568. depends="dist-lite"/>
  1569. </project>