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

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