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

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