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

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