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

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