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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598
  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="${ant.package}/types/XMLCatalogTest.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="com.ibm.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"> csc.found=${csc.found}</echo>
  489. </target>
  490. <!--
  491. ===================================================================
  492. Prepare the build
  493. ===================================================================
  494. -->
  495. <target name="prepare">
  496. <tstamp>
  497. <format property="year" pattern="yyyy"/>
  498. </tstamp>
  499. <filterchain id="ant.filters">
  500. <replacetokens>
  501. <token key="VERSION" value="${version}"/>
  502. <token key="DATE" value="${TODAY}"/>
  503. <token key="TIME" value="${TSTAMP}"/>
  504. </replacetokens>
  505. </filterchain>
  506. </target>
  507. <!--
  508. ===================================================================
  509. Build the code
  510. ===================================================================
  511. -->
  512. <target name="build"
  513. depends="prepare, check_for_optional_packages"
  514. description="--> compiles the source code">
  515. <mkdir dir="${build.dir}"/>
  516. <mkdir dir="${build.classes}"/>
  517. <mkdir dir="${build.lib}"/>
  518. <javac srcdir="${java.dir}"
  519. destdir="${build.classes}"
  520. debug="${debug}"
  521. deprecation="${deprecation}"
  522. target="${javac.target}"
  523. optimize="${optimize}" >
  524. <classpath refid="classpath"/>
  525. <selector id="conditional-patterns">
  526. <not>
  527. <or>
  528. <selector refid="needs.jdk1.2+" unless="jdk1.2+"/>
  529. <selector refid="needs.jdk1.3+" unless="jdk1.3+"/>
  530. <selector refid="needs.jdk1.4+" unless="jdk1.4+"/>
  531. <selector refid="needs.sun.tools" unless="sun.tools.present"/>
  532. <selector refid="needs.sun.uue" unless="sunuue.present"/>
  533. <selector refid="needs.sun.b64" unless="base64.present"/>
  534. <selector refid="needs.trax" unless="trax.present"/>
  535. <selector refid="needs.xalan1" unless="xalan.present"/>
  536. <selector refid="needs.xalan2" unless="xalan2.present"/>
  537. <selector refid="needs.xslp" unless="xslp.present"/>
  538. <selector refid="needs.apache.resolver" unless="apache.resolver.present"/>
  539. <selector refid="needs.junit" unless="junit.present"/>
  540. <selector refid="needs.jakarta.regexp"
  541. unless="jakarta.regexp.present"/>
  542. <selector refid="needs.jakarta.oro" unless="jakarta.oro.present"/>
  543. <selector refid="needs.jakarta.bcel" unless="bcel.present"/>
  544. <selector refid="needs.jakarta.log4j" unless="log4j.present"/>
  545. <selector refid="needs.commons.logging"
  546. unless="commons.logging.present"/>
  547. <selector refid="needs.bsf" unless="bsf.present"/>
  548. <selector refid="needs.stylebook" unless="stylebook.present"/>
  549. <selector refid="needs.javamail" unless="javamail.complete"/>
  550. <selector refid="needs.icontract" unless="icontract.present"/>
  551. <selector refid="needs.netrexx" unless="netrexx.present"/>
  552. <selector refid="needs.weblogic.ejbc" unless="ejb.ejbc.present"/>
  553. <selector refid="needs.weblogic.ddcreator"
  554. unless="ejb.DDCreator.present"/>
  555. <selector refid="needs.weblogic.server" unless="ejb.wls.present"/>
  556. <selector refid="needs.netcomponents" unless="netcomp.present"/>
  557. <selector refid="needs.starteam" unless="starteam.present"/>
  558. <selector refid="needs.vaj" unless="vaj.present"/>
  559. <selector refid="needs.antlr" unless="antlr.present"/>
  560. <selector refid="needs.servletapi" unless="servlet.present"/>
  561. <selector refid="needs.jmf" unless="jmf.present"/>
  562. <selector refid="needs.jai" unless="jai.present"/>
  563. <selector refid="needs.jdepend" unless="jdepend.present"/>
  564. <selector refid="needs.swing" unless="swing.present"/>
  565. </or>
  566. </not>
  567. </selector>
  568. </javac>
  569. <copy todir="${build.classes}">
  570. <fileset dir="${java.dir}">
  571. <include name="**/*.properties"/>
  572. <include name="**/*.dtd"/>
  573. </fileset>
  574. </copy>
  575. <copy todir="${build.classes}"
  576. overwrite="true">
  577. <fileset dir="${java.dir}">
  578. <include name="**/version.txt"/>
  579. <include name="**/defaultManifest.mf"/>
  580. </fileset>
  581. <filterchain refid="ant.filters"/>
  582. </copy>
  583. <copy todir="${build.classes}/${optional.package}/junit/xsl">
  584. <fileset dir="${etc.dir}">
  585. <include name="junit-frames.xsl"/>
  586. <include name="junit-noframes.xsl"/>
  587. </fileset>
  588. </copy>
  589. </target>
  590. <!--
  591. ===================================================================
  592. Create the Apache Ant jars: ant.jar and optional.jar
  593. ===================================================================
  594. -->
  595. <target name="jars"
  596. depends="build"
  597. description="--> creates the Apache Ant jars">
  598. <copy todir="${build.dir}">
  599. <fileset dir=".">
  600. <include name="LICENSE"/>
  601. <include name="LICENSE.xerces"/>
  602. <include name="LICENSE.dom"/>
  603. <include name="LICENSE.sax"/>
  604. </fileset>
  605. <mapper type="glob" from="*" to="*.txt"/>
  606. </copy>
  607. <copy file="${manifest}" tofile="${manifest.tmp}"/>
  608. <manifest file="${manifest.tmp}">
  609. <section name="${optional.package}/">
  610. <attribute name="Extension-name"
  611. value="org.apache.tools.ant"/>
  612. <attribute name="Specification-Title"
  613. value="Apache Ant"/>
  614. <attribute name="Specification-Version"
  615. value="${manifest-version}"/>
  616. <attribute name="Specification-Vendor"
  617. value="Apache Software Foundation"/>
  618. <attribute name="Implementation-Title"
  619. value="org.apache.tools.ant"/>
  620. <attribute name="Implementation-Version"
  621. value="${manifest-version}"/>
  622. <attribute name="Implementation-Vendor"
  623. value="Apache Software Foundation"/>
  624. </section>
  625. </manifest>
  626. <jar destfile="${build.lib}/${name}.jar"
  627. basedir="${build.classes}"
  628. manifest="${manifest}">
  629. <not>
  630. <selector id="non-core">
  631. <or>
  632. <filename name="${optional.package}/**"/>
  633. <filename name="${optional.type.package}/**"/>
  634. <filename name="${util.package}/depend/**"/>
  635. <filename name="${util.package}/optional/**"/>
  636. <selector refid="needs.jakarta.log4j"/>
  637. <selector refid="needs.commons.logging"/>
  638. <selector refid="needs.jakarta.regexp"/>
  639. <selector refid="needs.jakarta.oro"/>
  640. <selector refid="needs.jdk1.4+"/>
  641. <selector refid="needs.javamail"/>
  642. </or>
  643. </selector>
  644. </not>
  645. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  646. <manifest>
  647. <section name="${ant.package}/">
  648. <attribute name="Extension-name"
  649. value="org.apache.tools.ant"/>
  650. <attribute name="Specification-Title"
  651. value="Apache Ant"/>
  652. <attribute name="Specification-Version"
  653. value="${manifest-version}"/>
  654. <attribute name="Specification-Vendor"
  655. value="Apache Software Foundation"/>
  656. <attribute name="Implementation-Title"
  657. value="org.apache.tools.ant"/>
  658. <attribute name="Implementation-Version"
  659. value="${manifest-version}"/>
  660. <attribute name="Implementation-Vendor"
  661. value="Apache Software Foundation"/>
  662. </section>
  663. </manifest>
  664. <fileset dir="${docs.dir}">
  665. <include name="images/ant_logo_large.gif"/>
  666. </fileset>
  667. </jar>
  668. <jar destfile="${build.lib}/optional.jar"
  669. basedir="${build.classes}"
  670. manifest="${manifest.tmp}">
  671. <selector refid="non-core"/>
  672. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  673. </jar>
  674. <jar destfile="${build.lib}/${bootstrap.jar}"
  675. basedir="${build.classes}"
  676. manifest="${manifest}">
  677. <include name="${ant.package}/Main.class"/>
  678. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  679. <manifest>
  680. <attribute name="Class-Path"
  681. value="ant.jar xml-apis.jar xercesImpl.jar optional.jar xalan.jar"/>
  682. </manifest>
  683. </jar>
  684. <jar destfile="${build.lib}/nodeps.jar"
  685. basedir="${build.classes}"
  686. manifest="${manifest.tmp}">
  687. <and>
  688. <selector refid="non-core"/>
  689. <not>
  690. <or>
  691. <selector refid="needs.trax"/>
  692. <selector refid="needs.xalan1"/>
  693. <selector refid="needs.xalan2"/>
  694. <selector refid="needs.xslp"/>
  695. <selector refid="needs.apache.resolver"/>
  696. <selector refid="needs.junit"/>
  697. <selector refid="needs.jakarta.regexp"/>
  698. <selector refid="needs.jakarta.oro"/>
  699. <selector refid="needs.jakarta.bcel"/>
  700. <selector refid="needs.jakarta.log4j"/>
  701. <selector refid="needs.commons.logging"/>
  702. <selector refid="needs.bsf"/>
  703. <selector refid="needs.stylebook"/>
  704. <selector refid="needs.javamail"/>
  705. <selector refid="needs.icontract"/>
  706. <selector refid="needs.netrexx"/>
  707. <selector refid="needs.weblogic.ejbc"/>
  708. <selector refid="needs.weblogic.ddcreator"/>
  709. <selector refid="needs.weblogic.server"/>
  710. <selector refid="needs.netcomponents"/>
  711. <selector refid="needs.starteam"/>
  712. <selector refid="needs.vaj"/>
  713. <selector refid="needs.antlr"/>
  714. <selector refid="needs.servletapi"/>
  715. <selector refid="needs.jmf"/>
  716. <selector refid="needs.jai"/>
  717. <selector refid="needs.jdepend"/>
  718. <selector refid="needs.swing"/>
  719. </or>
  720. </not>
  721. </and>
  722. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  723. </jar>
  724. <jar destfile="${build.lib}/${optional.jars.prefix}-trax.jar"
  725. basedir="${build.classes}"
  726. manifest="${manifest.tmp}">
  727. <selector refid="needs.trax"/>
  728. </jar>
  729. <jar destfile="${build.lib}/${optional.jars.prefix}-xalan1.jar"
  730. basedir="${build.classes}"
  731. manifest="${manifest.tmp}">
  732. <selector refid="needs.xalan1"/>
  733. </jar>
  734. <jar destfile="${build.lib}/${optional.jars.prefix}-xalan2.jar"
  735. basedir="${build.classes}"
  736. manifest="${manifest.tmp}">
  737. <selector refid="needs.xalan2"/>
  738. </jar>
  739. <jar destfile="${build.lib}/${optional.jars.prefix}-xslp.jar"
  740. basedir="${build.classes}"
  741. manifest="${manifest.tmp}">
  742. <selector refid="needs.xslp"/>
  743. </jar>
  744. <jar destfile="${build.lib}/${optional.jars.prefix}-apache-resolver.jar"
  745. basedir="${build.classes}"
  746. manifest="${manifest.tmp}">
  747. <selector refid="needs.apache.resolver"/>
  748. </jar>
  749. <jar destfile="${build.lib}/${optional.jars.prefix}-junit.jar"
  750. basedir="${build.classes}"
  751. manifest="${manifest.tmp}">
  752. <selector refid="needs.junit"/>
  753. </jar>
  754. <jar destfile="${build.lib}/${optional.jars.prefix}-jakarta-regexp.jar"
  755. basedir="${build.classes}" manifest="${manifest.tmp}">
  756. <selector refid="needs.jakarta.regexp"/>
  757. </jar>
  758. <jar destfile="${build.lib}/${optional.jars.prefix}-oro.jar"
  759. basedir="${build.classes}"
  760. manifest="${manifest.tmp}">
  761. <selector refid="needs.jakarta.oro"/>
  762. </jar>
  763. <jar destfile="${build.lib}/${optional.jars.prefix}-bcel.jar"
  764. basedir="${build.classes}"
  765. manifest="${manifest.tmp}">
  766. <selector refid="needs.jakarta.bcel"/>
  767. </jar>
  768. <jar destfile="${build.lib}/${optional.jars.prefix}-log4j.jar"
  769. basedir="${build.classes}"
  770. manifest="${manifest.tmp}">
  771. <selector refid="needs.jakarta.log4j"/>
  772. </jar>
  773. <jar destfile="${build.lib}/${optional.jars.prefix}-commons-logging.jar"
  774. basedir="${build.classes}" manifest="${manifest.tmp}">
  775. <selector refid="needs.commons.logging"/>
  776. </jar>
  777. <jar destfile="${build.lib}/${optional.jars.prefix}-bsf.jar"
  778. basedir="${build.classes}"
  779. manifest="${manifest.tmp}">
  780. <selector refid="needs.bsf"/>
  781. </jar>
  782. <jar destfile="${build.lib}/${optional.jars.prefix}-stylebook.jar"
  783. basedir="${build.classes}"
  784. manifest="${manifest.tmp}">
  785. <selector refid="needs.stylebook"/>
  786. </jar>
  787. <jar destfile="${build.lib}/${optional.jars.prefix}-javamail.jar"
  788. basedir="${build.classes}"
  789. manifest="${manifest.tmp}">
  790. <selector refid="needs.javamail"/>
  791. </jar>
  792. <jar destfile="${build.lib}/${optional.jars.prefix}-icontract.jar"
  793. basedir="${build.classes}"
  794. manifest="${manifest.tmp}">
  795. <selector refid="needs.icontract"/>
  796. </jar>
  797. <jar destfile="${build.lib}/${optional.jars.prefix}-netrexx.jar"
  798. basedir="${build.classes}"
  799. manifest="${manifest.tmp}">
  800. <selector refid="needs.netrexx"/>
  801. </jar>
  802. <jar destfile="${build.lib}/${optional.jars.prefix}-netcomp.jar"
  803. basedir="${build.classes}"
  804. manifest="${manifest.tmp}">
  805. <selector refid="needs.netcomponents"/>
  806. </jar>
  807. <jar destfile="${build.lib}/${optional.jars.prefix}-starteam.jar"
  808. basedir="${build.classes}"
  809. manifest="${manifest.tmp}">
  810. <selector refid="needs.starteam"/>
  811. </jar>
  812. <jar destfile="${build.lib}/${optional.jars.prefix}-vaj.jar"
  813. basedir="${build.classes}"
  814. manifest="${manifest.tmp}">
  815. <selector refid="needs.vaj"/>
  816. </jar>
  817. <jar destfile="${build.lib}/${optional.jars.prefix}-antlr.jar"
  818. basedir="${build.classes}"
  819. manifest="${manifest.tmp}">
  820. <selector refid="needs.antlr"/>
  821. </jar>
  822. <jar destfile="${build.lib}/${optional.jars.prefix}-jmf.jar"
  823. basedir="${build.classes}"
  824. manifest="${manifest.tmp}">
  825. <selector refid="needs.jmf"/>
  826. </jar>
  827. <jar destfile="${build.lib}/${optional.jars.prefix}-jai.jar"
  828. basedir="${build.classes}"
  829. manifest="${manifest.tmp}">
  830. <selector refid="needs.jai"/>
  831. </jar>
  832. <jar destfile="${build.lib}/${optional.jars.prefix}-swing.jar"
  833. basedir="${build.classes}"
  834. manifest="${manifest.tmp}">
  835. <selector refid="needs.swing"/>
  836. </jar>
  837. <jar destfile="${build.lib}/${optional.jars.prefix}-jdepend.jar"
  838. basedir="${build.classes}"
  839. manifest="${manifest.tmp}">
  840. <selector refid="needs.jdepend"/>
  841. </jar>
  842. <jar destfile="${build.lib}/${optional.jars.prefix}-weblogic.jar"
  843. basedir="${build.classes}"
  844. manifest="${manifest.tmp}">
  845. <or>
  846. <selector refid="needs.weblogic.ejbc"/>
  847. <selector refid="needs.weblogic.ddcreator" />
  848. <selector refid="needs.weblogic.server"/>
  849. </or>
  850. </jar>
  851. </target>
  852. <!-- Creates jar of test utility classes -->
  853. <target name="test-jar"
  854. depends="compile-tests"
  855. description="--> creates the Apache Ant Test Utilties jar">
  856. <jar destfile="${build.lib}/${name}-testutil.jar"
  857. basedir="${build.tests}">
  858. <patternset refid="useful.tests"/>
  859. </jar>
  860. </target>
  861. <!--
  862. ===================================================================
  863. Create the essential distribution that can run Apache Ant
  864. ===================================================================
  865. -->
  866. <target name="dist-lite"
  867. depends="jars"
  868. description="--> creates a minimum distribution to run Apache Ant">
  869. <mkdir dir="${dist.dir}"/>
  870. <mkdir dir="${dist.bin}"/>
  871. <mkdir dir="${dist.lib}"/>
  872. <copy todir="${dist.lib}">
  873. <fileset dir="${build.lib}">
  874. <exclude name="${bootstrap.jar}"/>
  875. </fileset>
  876. </copy>
  877. <copy todir="${dist.bin}">
  878. <fileset dir="${script.dir}/"/>
  879. </copy>
  880. <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="*.bat"/>
  881. <fixcrlf srcdir="${dist.bin}" eol="lf">
  882. <include name="ant"/>
  883. <include name="antRun"/>
  884. <include name="*.pl"/>
  885. </fixcrlf>
  886. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  887. failonerror="${chmod.fail}"/>
  888. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  889. failonerror="${chmod.fail}"/>
  890. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  891. <fileset dir="${dist.bin}">
  892. <include name="**/ant"/>
  893. <include name="**/antRun"/>
  894. <include name="**/*.pl"/>
  895. <include name="**/*.py"/>
  896. </fileset>
  897. </chmod>
  898. </target>
  899. <!--
  900. ===================================================================
  901. Create the complete distribution
  902. ===================================================================
  903. -->
  904. <target name="dist" description="--> creates a complete distribution">
  905. <antcall inheritAll="false" target="internal_dist">
  906. <param name="dist.dir" value="${dist.name}"/>
  907. </antcall>
  908. </target>
  909. <target name="dist_javadocs" depends="javadocs">
  910. <mkdir dir="${dist.javadocs}"/>
  911. <copy todir="${dist.javadocs}" overwrite="true">
  912. <fileset dir="${build.javadocs}"/>
  913. </copy>
  914. </target>
  915. <target name="internal_dist" depends="dist-lite,dist_javadocs">
  916. <mkdir dir="${dist.docs}"/>
  917. <mkdir dir="${dist.etc}"/>
  918. <copy todir="${dist.lib}">
  919. <fileset dir="${lib.dir}">
  920. <include name="*.jar"/>
  921. <include name="*.zip"/>
  922. </fileset>
  923. </copy>
  924. <copy todir="${dist.lib}" file="${lib.dir}/README"/>
  925. <copy todir="${dist.docs}">
  926. <fileset dir="${docs.dir}" excludes="${unfiltered.files}"/>
  927. <filterchain refid="ant.filters"/>
  928. </copy>
  929. <copy todir="${dist.docs}" filtering="false">
  930. <fileset dir="${docs.dir}" includes="${unfiltered.files}"/>
  931. </copy>
  932. <copy todir="${dist.dir}">
  933. <fileset dir=".">
  934. <include name="README"/>
  935. <include name="LICENSE"/>
  936. <include name="LICENSE.xerces"/>
  937. <include name="LICENSE.dom"/>
  938. <include name="LICENSE.sax"/>
  939. <include name="TODO"/>
  940. <include name="WHATSNEW"/>
  941. <include name="KEYS"/>
  942. <include name="welcome.html"/>
  943. </fileset>
  944. </copy>
  945. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  946. failonerror="${chmod.fail}"/>
  947. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  948. failonerror="${chmod.fail}"/>
  949. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  950. <fileset dir="${dist.bin}">
  951. <include name="**/ant"/>
  952. <include name="**/antRun"/>
  953. <include name="**/*.pl"/>
  954. <include name="**/*.py"/>
  955. </fileset>
  956. </chmod>
  957. <!-- publish some useful stylesheets -->
  958. <copy todir="${dist.etc}">
  959. <fileset dir="${etc.dir}">
  960. <include name="junit-frames.xsl"/>
  961. <include name="junit-noframes.xsl"/>
  962. <include name="coverage-frames.xsl"/>
  963. <include name="maudit-frames.xsl"/>
  964. <include name="mmetrics-frames.xsl"/>
  965. <include name="changelog.xsl"/>
  966. <include name="jdepend.xsl"/>
  967. <include name="jdepend-frames.xsl"/>
  968. <include name="checkstyle-frames.xsl"/>
  969. <include name="log.xsl"/>
  970. <include name="tagdiff.xsl"/>
  971. </fileset>
  972. <fileset dir="${build.lib}">
  973. <include name="${bootstrap.jar}"/>
  974. </fileset>
  975. </copy>
  976. </target>
  977. <!--
  978. ===================================================================
  979. Target to create bootstrap build
  980. ===================================================================
  981. -->
  982. <target name="bootstrap" description="--> creates a bootstrap build">
  983. <antcall inheritAll="false" target="dist-lite">
  984. <param name="dist.dir" value="${bootstrap.dir}"/>
  985. </antcall>
  986. </target>
  987. <!--
  988. ===================================================================
  989. Create the source distribution
  990. ===================================================================
  991. -->
  992. <target name="src-dist"
  993. description="--> creates a source distribution">
  994. <mkdir dir="${src.dist.dir}"/>
  995. <copy todir="${src.dist.lib}">
  996. <fileset dir="${lib.dir}">
  997. <include name="*.jar"/>
  998. <include name="*.zip"/>
  999. <include name="README"/>
  1000. </fileset>
  1001. </copy>
  1002. <copy todir="${src.dist.src}">
  1003. <fileset dir="${src.dir}"/>
  1004. </copy>
  1005. <copy todir="${src.dist.docs}">
  1006. <fileset dir="${docs.dir}">
  1007. <exclude name="manual/api/**"/>
  1008. </fileset>
  1009. </copy>
  1010. <copy todir="${src.dist.dir}">
  1011. <fileset dir=".">
  1012. <include name="README"/>
  1013. <include name="LICENSE"/>
  1014. <include name="LICENSE.xerces"/>
  1015. <include name="LICENSE.dom"/>
  1016. <include name="LICENSE.sax"/>
  1017. <include name="TODO"/>
  1018. <include name="WHATSNEW"/>
  1019. <include name="KEYS"/>
  1020. <include name="build.bat"/>
  1021. <include name="build.sh"/>
  1022. <include name="bootstrap.bat"/>
  1023. <include name="bootstrap.sh"/>
  1024. <include name="build.xml"/>
  1025. <include name="welcome.html"/>
  1026. </fileset>
  1027. </copy>
  1028. <fixcrlf srcdir="${src.dist.dir}" eol="crlf" includes="*.bat"/>
  1029. <fixcrlf srcdir="${src.dist.dir}" eol="lf">
  1030. <include name="**/*.sh"/>
  1031. <include name="**/*.pl"/>
  1032. <include name="**/ant"/>
  1033. <include name="**/antRun"/>
  1034. </fixcrlf>
  1035. <fixcrlf srcdir="${src.dist.dir}">
  1036. <include name="**/*.java"/>
  1037. </fixcrlf>
  1038. <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
  1039. failonerror="${chmod.fail}"/>
  1040. <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}"/>
  1041. <chmod perm="ugo+x" failonerror="${chmod.fail}">
  1042. <fileset dir="${src.dist.dir}">
  1043. <include name="**/.sh"/>
  1044. <include name="**/.pl"/>
  1045. <include name="**/.py"/>
  1046. <include name="**/ant"/>
  1047. <include name="**/antRun"/>
  1048. </fileset>
  1049. </chmod>
  1050. </target>
  1051. <!--
  1052. ===================================================================
  1053. Create the binary distribution
  1054. ===================================================================
  1055. -->
  1056. <target name="main_distribution"
  1057. description="--> creates the zip and tar distributions">
  1058. <delete dir="${dist.name}"/>
  1059. <mkdir dir="${dist.base}"/>
  1060. <mkdir dir="${dist.base}/src"/>
  1061. <mkdir dir="${dist.base}/bin"/>
  1062. <antcall inheritAll="false" target="internal_dist">
  1063. <param name="dist.dir" value="${dist.name}"/>
  1064. </antcall>
  1065. <zip destfile="${dist.base}/bin/${dist.name}-bin.zip"
  1066. basedir="${dist.name}/.."
  1067. includes="${dist.name}/**"/>
  1068. <tar longfile="gnu"
  1069. destfile="${dist.base}/bin/${dist.name}-bin.tar">
  1070. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  1071. <include name="${dist.name}/bin/ant"/>
  1072. <include name="${dist.name}/bin/antRun"/>
  1073. <include name="${dist.name}/bin/*.pl"/>
  1074. <include name="${dist.name}/bin/*.py"/>
  1075. </tarfileset>
  1076. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  1077. <include name="${dist.name}/**"/>
  1078. <exclude name="${dist.name}/bin/ant"/>
  1079. <exclude name="${dist.name}/bin/antRun"/>
  1080. <exclude name="${dist.name}/bin/*.pl"/>
  1081. <exclude name="${dist.name}/bin/*.py"/>
  1082. </tarfileset>
  1083. </tar>
  1084. <gzip zipfile="${dist.base}/bin/${dist.name}-bin.tar.gz"
  1085. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  1086. <bzip2 zipfile="${dist.base}/bin/${dist.name}-bin.tar.bz2"
  1087. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  1088. <delete file="${dist.base}/bin/${dist.name}-bin.tar"/>
  1089. <delete dir="${dist.name}"/>
  1090. <checksum fileext=".md5">
  1091. <fileset dir="${dist.base}/bin/">
  1092. <include name="**/*"/>
  1093. <exclude name="**/*.asc"/>
  1094. <exclude name="**/*.md5"/>
  1095. </fileset>
  1096. </checksum>
  1097. <antcall inheritAll="false" target="src-dist">
  1098. <param name="src.dist.dir" value="${dist.name}"/>
  1099. </antcall>
  1100. <zip destfile="${dist.base}/src/${dist.name}-src.zip"
  1101. basedir="${dist.name}/.."
  1102. includes="${dist.name}/**"/>
  1103. <tar longfile="gnu"
  1104. destfile="${dist.base}/src/${dist.name}-src.tar" >
  1105. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  1106. <include name="${dist.name}/bootstrap.sh"/>
  1107. <include name="${dist.name}/build.sh"/>
  1108. </tarfileset>
  1109. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  1110. <include name="${dist.name}/**"/>
  1111. <exclude name="${dist.name}/bootstrap.sh"/>
  1112. <exclude name="${dist.name}/build.sh"/>
  1113. </tarfileset>
  1114. </tar>
  1115. <gzip zipfile="${dist.base}/src/${dist.name}-src.tar.gz"
  1116. src="${dist.base}/src/${dist.name}-src.tar"/>
  1117. <bzip2 zipfile="${dist.base}/src/${dist.name}-src.tar.bz2"
  1118. src="${dist.base}/src/${dist.name}-src.tar"/>
  1119. <delete file="${dist.base}/src/${dist.name}-src.tar"/>
  1120. <delete dir="${dist.name}"/>
  1121. <checksum fileext=".md5">
  1122. <fileset dir="${dist.base}/src/">
  1123. <include name="**/*"/>
  1124. <exclude name="**/*.asc"/>
  1125. <exclude name="**/*.md5"/>
  1126. </fileset>
  1127. </checksum>
  1128. </target>
  1129. <target name="distribution" depends="main_distribution"
  1130. description="--> creates the full Apache Ant distribution">
  1131. </target>
  1132. <!--
  1133. ===================================================================
  1134. Cleans up build and distribution directories
  1135. ===================================================================
  1136. -->
  1137. <target name="clean"
  1138. description="--> cleans up build and dist directories">
  1139. <delete dir="${build.dir}"/>
  1140. <delete dir="${dist.base}"/>
  1141. <delete dir="${dist.dir}"/>
  1142. <delete>
  1143. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  1144. </delete>
  1145. </target>
  1146. <!--
  1147. ===================================================================
  1148. Cleans everything
  1149. ===================================================================
  1150. -->
  1151. <target name="allclean"
  1152. depends="clean"
  1153. description="--> cleans up everything">
  1154. <delete file="${bootstrap.dir}/bin/antRun"/>
  1155. <delete file="${bootstrap.dir}/bin/antRun.bat"/>
  1156. <delete file="${bootstrap.dir}/bin/*.pl"/>
  1157. <delete file="${bootstrap.dir}/bin/*.py"/>
  1158. </target>
  1159. <!--
  1160. ===================================================================
  1161. Installs Apache Ant
  1162. ===================================================================
  1163. -->
  1164. <target name="install" if="ant.install">
  1165. <antcall inheritAll="false" target="internal_dist">
  1166. <param name="dist.dir" value="${ant.install}"/>
  1167. </antcall>
  1168. </target>
  1169. <target name="install-lite" if="ant.install">
  1170. <antcall inheritAll="false" target="dist-lite">
  1171. <param name="dist.dir" value="${ant.install}"/>
  1172. </antcall>
  1173. </target>
  1174. <!--
  1175. ===================================================================
  1176. Creates the API documentation
  1177. ===================================================================
  1178. -->
  1179. <target name="javadoc_check">
  1180. <uptodate property="javadoc.notrequired"
  1181. targetfile="${build.javadocs}/packages.html" >
  1182. <srcfiles dir= "${java.dir}" includes="**/*.java"/>
  1183. </uptodate>
  1184. <uptodate property="tests.javadoc.notrequired"
  1185. targetfile="${build.tests.javadocs}/packages.html" >
  1186. <srcfiles dir= "${tests.dir}">
  1187. <patternset refid="useful.tests"/>
  1188. </srcfiles>
  1189. </uptodate>
  1190. </target>
  1191. <target name="javadocs" depends="prepare, javadoc_check"
  1192. unless="javadoc.notrequired"
  1193. description="--> creates the API documentation">
  1194. <mkdir dir="${build.javadocs}"/>
  1195. <javadoc useexternalfile="yes"
  1196. destdir="${build.javadocs}"
  1197. author="true"
  1198. version="true"
  1199. locale="en"
  1200. windowtitle="${Name} API"
  1201. doctitle="${Name}">
  1202. <packageset dir="${java.dir}"/>
  1203. <tag name="todo" description="To do:" scope="all"/>
  1204. <tag name="ant.task" enabled="false" description="Task:" scope="types"/>
  1205. <tag name="ant.datatype" enabled="false" description="Data type:" scope="types"/>
  1206. <group title="Apache Ant Core" packages="org.apache.tools.ant*"/>
  1207. <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*"/>
  1208. <group title="Core Types" packages="org.apache.tools.ant.types*"/>
  1209. <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*"/>
  1210. <group title="Optional Types" packages="org.apache.tools.ant.types.optional*"/>
  1211. <group title="Ant Utilities" packages="org.apache.tools.ant.util*"/>
  1212. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1213. </javadoc>
  1214. </target>
  1215. <target name="test-javadocs" depends="prepare, javadoc_check"
  1216. unless="tests.javadoc.notrequired"
  1217. description="--> creates the API documentation for test utilities">
  1218. <mkdir dir="${build.tests.javadocs}"/>
  1219. <javadoc useexternalfile="yes"
  1220. destdir="${build.tests.javadocs}"
  1221. author="true"
  1222. version="true"
  1223. locale="en"
  1224. windowtitle="${Name} Test Utilities"
  1225. doctitle="${Name}">
  1226. <fileset dir="${tests.dir}">
  1227. <patternset refid="useful.tests"/>
  1228. </fileset>
  1229. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1230. </javadoc>
  1231. </target>
  1232. <!--
  1233. ===================================================================
  1234. Compile testcases
  1235. ===================================================================
  1236. -->
  1237. <target name="compile-tests" depends="build" if="junit.present">
  1238. <mkdir dir="${build.tests}"/>
  1239. <javac srcdir="${tests.dir}"
  1240. destdir="${build.tests}"
  1241. debug="${debug}"
  1242. target="${javac.target}"
  1243. deprecation="${deprecation}" >
  1244. <classpath refid="tests-classpath"/>
  1245. <selector refid="conditional-patterns"/>
  1246. </javac>
  1247. </target>
  1248. <target name="dump-info" depends="dump-sys-properties,run-which"/>
  1249. <target name="dump-sys-properties" unless="which.present"
  1250. depends="xml-check">
  1251. <echo message="java.vm.info=${java.vm.info}"/>
  1252. <echo message="java.vm.name=${java.vm.name}"/>
  1253. <echo message="java.vm.vendor=${java.vm.vendor}"/>
  1254. <echo message="java.vm.version=${java.vm.version}"/>
  1255. <echo message="os.arch=${os.arch}"/>
  1256. <echo message="os.name=${os.name}"/>
  1257. <echo message="os.version=${os.version}"/>
  1258. <echo message="file.encoding=${file.encoding}"/>
  1259. <echo message="user.language=${user.language}"/>
  1260. </target>
  1261. <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
  1262. <target name="xml-check" depends="check_for_optional_packages"
  1263. if="xalan.envcheck" unless="which.present">
  1264. <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
  1265. </target>
  1266. <target name="run-which" depends="check_for_optional_packages"
  1267. if="which.present">
  1268. <java classname="org.apache.env.Which" taskname="which"/>
  1269. </target>
  1270. <!-- test to see if we are online or not. can take a while when we are off line, so
  1271. setting the property is a good shortcut-->
  1272. <target name="probe-offline">
  1273. <condition property="offline">
  1274. <or>
  1275. <isset property="offline"/>
  1276. <not>
  1277. <http url="http://www.apache.org/"/>
  1278. </not>
  1279. </or>
  1280. </condition>
  1281. <echo level="verbose" > offline=${offline}</echo>
  1282. </target>
  1283. <!--
  1284. ===================================================================
  1285. Run testcase
  1286. ===================================================================
  1287. -->
  1288. <target name="test" depends="run-tests" description="--> run JUnit tests"/>
  1289. <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present">
  1290. <condition property="run.junitreport">
  1291. <or>
  1292. <isset property="xalan2.present"/>
  1293. <and>
  1294. <isset property="xalan.present"/>
  1295. <isset property="bsf.present"/>
  1296. </and>
  1297. </or>
  1298. </condition>
  1299. <junit printsummary="${junit.summary}" haltonfailure="${test.haltonfailure}"
  1300. filtertrace="${junit.filtertrace}"
  1301. fork="${junit.fork}">
  1302. <!-- <jvmarg value="-classic"/> -->
  1303. <classpath refid="tests-classpath"/>
  1304. <classpath refid="classes.zip"/>
  1305. <sysproperty key="ant.home" value="${ant.home}"/>
  1306. <sysproperty key="build.tests" value="${build.tests}"/>
  1307. <sysproperty key="tests-classpath.value"
  1308. value="${tests-classpath.value}"/>
  1309. <formatter type="brief" usefile="false"/>
  1310. <batchtest>
  1311. <fileset dir="${tests.dir}">
  1312. <include name="**/*Test*"/>
  1313. <!-- abstract classes, not testcases -->
  1314. <exclude name="${ant.package}/taskdefs/TaskdefsTest.java"/>
  1315. <exclude name="${ant.package}/BuildFileTest.java"/>
  1316. <exclude name="${regexp.package}/RegexpMatcherTest.java"/>
  1317. <exclude name="${regexp.package}/RegexpTest.java"/>
  1318. <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java"/>
  1319. <exclude name="${ant.package}/types/AbstractFileSetTest.java"/>
  1320. <exclude name="${ant.package}/types/selectors/BaseSelectorTest.java"/>
  1321. <!-- helper classes, not testcases -->
  1322. <exclude name="org/example/**"/>
  1323. <exclude name="${ant.package}/taskdefs/TaskdefTest*Task.java"/>
  1324. <!-- interactive test -->
  1325. <exclude name="${ant.package}/taskdefs/TestProcess.java"/>
  1326. <!-- only run these tests if their required libraries are
  1327. installed -->
  1328. <selector refid="conditional-patterns"/>
  1329. <!-- fails under 1.1 -->
  1330. <exclude name="${optional.package}/perforce/P4ChangeTest.java"
  1331. unless="jdk1.2+"/>
  1332. <!-- tests excluded if the test is run in offline mode -->
  1333. <patternset refid="onlinetests"/>
  1334. <!-- failing tests excluded unless run.failing.tests is set -->
  1335. <patternset refid="teststhatfail"/>
  1336. <!-- runtime dependencies that are different from compile
  1337. time dependencies -->
  1338. <exclude name="${optional.package}/ReplaceRegExpTest.java"
  1339. unless="some.regexp.support"/>
  1340. <exclude name="${optional.package}/sitraka/*.java"
  1341. unless="some.regexp.support"/>
  1342. <!-- fail if testcases can be loaded from the system classloader -->
  1343. <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  1344. if="tests.are.on.system.classpath"/>
  1345. <exclude name="${optional.package}/sitraka/XMLReportTest.java"
  1346. if="tests.are.on.system.classpath"/>
  1347. <!-- these tests need to be localised before being ran???? -->
  1348. <exclude name="${optional.package}/PvcsTest.java"/>
  1349. <!-- These tests need a TraX implementation like xalan2 or saxon -->
  1350. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1351. unless="trax.impl.present"/>
  1352. <exclude name="${optional.package}/XsltTest.java"
  1353. unless="trax.impl.present"/>
  1354. <exclude name="${ant.package}/types/XMLCatalogBuildFileTest.java"
  1355. unless="trax.impl.present"/>
  1356. <exclude name="${optional.package}/junit/JUnitReportTest.java"
  1357. unless="run.junitreport"/>
  1358. <!-- needs BSF to work -->
  1359. <exclude name="${optional.package}/XalanLiaisonTest.java"
  1360. unless="bsf.present"/>
  1361. <!--
  1362. XXX need to figure out what's causing this InvocationTargetException
  1363. -->
  1364. <exclude name="${optional.package}/junit/JUnitTestRunnerTest.java"
  1365. unless="jdk1.2+"/>
  1366. <!-- DateTime handling seems to be broken in JDK 1.1 -->
  1367. <exclude name="${util.package}/DateUtilsTest.java"
  1368. unless="jdk1.2+"/>
  1369. <exclude name="${optional.package}/JspcTest.java"/>
  1370. <!-- misc oneoff tests -->
  1371. <exclude name="${optional.package}/WsdlToDotnetTest.java"
  1372. unless="dotnetapps.found"/>
  1373. <!-- These tests only passes if testcases and Ant classes have
  1374. been loaded by the same classloader - will throw
  1375. IllegalAccessExceptions otherwise. -->
  1376. <exclude name="${ant.package}/taskdefs/SQLExecTest.java"
  1377. unless="tests.and.ant.share.classloader"/>
  1378. <exclude name="${optional.package}/sos/SOSTest.java"
  1379. unless="tests.and.ant.share.classloader"/>
  1380. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1381. unless="tests.and.ant.share.classloader"/>
  1382. <exclude name="${optional.package}/metamata/MAuditParserTest.java"
  1383. unless="tests.and.ant.share.classloader"/>
  1384. <!-- can only run if cvs is installed on your machine
  1385. enable by setting the property have.cvs
  1386. -->
  1387. <exclude name="${ant.package}/taskdefs/AbstractCvsTaskTest.java"
  1388. unless="have.cvs"/>
  1389. </fileset>
  1390. </batchtest>
  1391. <test name="org.apache.tools.ant.taskdefs.optional.JspcTest"
  1392. if="jasper.present"/>
  1393. </junit>
  1394. </target>
  1395. <target name="run-single-test" if="testcase" depends="compile-tests,run-single-test-only"
  1396. description="--> runs the single unit test defined in the testcase property"/>
  1397. <target name="run-single-test-only"
  1398. description="--> runs the single unit test defined in the testcase property">
  1399. <junit printsummary="${junit.summary}"
  1400. haltonfailure="${test.haltonfailure}"
  1401. fork="${junit.fork}"
  1402. filtertrace="${junit.filtertrace}">
  1403. <!-- <jvmarg value="-classic"/> -->
  1404. <sysproperty key="ant.home" value="${ant.home}"/>
  1405. <sysproperty key="build.tests" value="${build.tests}"/>
  1406. <sysproperty key="tests-classpath.value"
  1407. value="${tests-classpath.value}"/>
  1408. <classpath refid="classes.zip"/>
  1409. <classpath refid="tests-classpath"/>
  1410. <formatter type="plain" usefile="false"/>
  1411. <test name="${testcase}"/>
  1412. </junit>
  1413. </target>
  1414. <target name="interactive-tests" description="--> runs interactive tests"
  1415. depends="compile-tests"
  1416. if="jdk1.3+">
  1417. <java classpathref="tests-classpath"
  1418. classname="org.apache.tools.ant.taskdefs.TestProcess"
  1419. fork="true"/>
  1420. </target>
  1421. <!--
  1422. ===================================================================
  1423. Main target - runs dist-lite by default
  1424. ===================================================================
  1425. -->
  1426. <target name="main"
  1427. description="--> creates a minimum distribution in ./dist"
  1428. depends="dist-lite"/>
  1429. </project>