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

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