You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 62 kB

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