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

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