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

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