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

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