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

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