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

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