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

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