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

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