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

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