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

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