You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 68 kB

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