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

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