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

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