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

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