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

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