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

build.xml 60 kB

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