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

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