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

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