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 67 kB

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