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

build.xml 62 kB

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