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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605
  1. <?xml version="1.0"?>
  2. <!--
  3. =======================================================================
  4. Apache Ant own build file
  5. Copyright (c) 2000-2002 The Apache Software Foundation. All rights
  6. reserved.
  7. =======================================================================
  8. -->
  9. <project default="main" basedir=".">
  10. <!-- Give user a chance to override without editing this file
  11. (and without typing -D each time it compiles it) -->
  12. <property file=".ant.properties"/>
  13. <property file="${user.home}/.ant.properties"/>
  14. <property environment="env"/>
  15. <property name="Name" value="Apache Ant"/>
  16. <property name="name" value="ant"/>
  17. <property name="version" value="1.6alpha"/>
  18. <property name="manifest-version" value="1.5.9"/>
  19. <property name="bootstrap.jar" value="ant-bootstrap.jar"/>
  20. <property name="debug" value="true"/>
  21. <property name="chmod.fail" value="true"/>
  22. <property name="deprecation" value="false"/>
  23. <property name="optimize" value="true"/>
  24. <property name="javac.target" value="1.1"/>
  25. <property name="junit.fork" value="false"/>
  26. <property name="junit.filtertrace" value="off"/>
  27. <property name="junit.summary" value="no"/>
  28. <!--
  29. ===================================================================
  30. Set the properties related to the source tree
  31. ===================================================================
  32. -->
  33. <property name="src.dir" value="src"/>
  34. <property name="java.dir" value="${src.dir}/main"/>
  35. <property name="script.dir" value="${src.dir}/script"/>
  36. <property name="lib.dir" value="lib"/>
  37. <property name="docs.dir" value="docs"/>
  38. <property name="etc.dir" value="src/etc"/>
  39. <property name="tests.dir" value="src/testcases"/>
  40. <property name="tests.etc.dir" value="src/etc/testcases"/>
  41. <property name="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="${ant.package}/taskdefs/Get*"/>
  151. <filename name="${optional.package}/splash/SplashTask*"/>
  152. </or>
  153. </selector>
  154. <!-- depends on external libraries -->
  155. <selector id="needs.trax">
  156. <or>
  157. <filename name="${optional.package}/TraXLiaison*"/>
  158. <filename name="${optional.package}/sitraka/**"/>
  159. <filename name="${optional.package}/metamata/MMetrics*"/>
  160. <filename name="${optional.package}/XsltTest*"/>
  161. <filename name="${ant.package}/types/XMLCatalogBuildFileTest*"/>
  162. </or>
  163. </selector>
  164. <selector id="needs.xalan1">
  165. <or>
  166. <filename name="${optional.package}/XalanLiaison*"/>
  167. <filename name="${optional.package}/junit/Xalan1Executor*"/>
  168. </or>
  169. </selector>
  170. <selector id="needs.xalan2">
  171. <filename name="${optional.package}/junit/Xalan2Executor*"/>
  172. </selector>
  173. <selector id="needs.xslp">
  174. <filename name="${optional.package}/XslpLiaison*"/>
  175. </selector>
  176. <selector id="needs.apache.resolver">
  177. <filename name="${apache.resolver.type.package}/**"/>
  178. </selector>
  179. <selector id="needs.junit">
  180. <filename name="${optional.package}/junit/**"/>
  181. </selector>
  182. <selector id="needs.jakarta.regexp">
  183. <filename name="${regexp.package}/JakartaRegexp*"/>
  184. </selector>
  185. <selector id="needs.jakarta.oro">
  186. <or>
  187. <filename name="${regexp.package}/JakartaOro*"/>
  188. <filename name="${optional.package}/perforce/*"/>
  189. <filename name="${optional.package}/metamata/MAudit*"/>
  190. </or>
  191. </selector>
  192. <selector id="needs.jakarta.bcel">
  193. <or>
  194. <filename name="${ant.package}/filters/util/JavaClassHelper*"/>
  195. <filename name="${util.package}/depend/bcel/*"/>
  196. <filename name="${optional.type.package}/depend/ClassFileSetTest*"/>
  197. </or>
  198. </selector>
  199. <selector id="needs.jakarta.log4j">
  200. <filename name="${ant.package}/listener/Log4jListener*"/>
  201. </selector>
  202. <selector id="needs.commons.logging">
  203. <filename name="${ant.package}/listener/CommonsLoggingListener*"/>
  204. </selector>
  205. <selector id="needs.bsf">
  206. <filename name="${optional.package}/Script*"/>
  207. </selector>
  208. <selector id="needs.stylebook">
  209. <filename name="${optional.package}/StyleBook*"/>
  210. </selector>
  211. <selector id="needs.javamail">
  212. <filename name="${ant.package}/taskdefs/email/MimeMailer*"/>
  213. </selector>
  214. <selector id="needs.icontract">
  215. <filename name="${optional.package}/IContract*"/>
  216. </selector>
  217. <selector id="needs.netrexx">
  218. <filename name="${optional.package}/NetRexxC*"/>
  219. </selector>
  220. <selector id="needs.weblogic.ejbc">
  221. <filename name="${optional.package}/ejb/Ejbc*"/>
  222. </selector>
  223. <selector id="needs.weblogic.ddcreator">
  224. <filename name="${optional.package}/ejb/DDCreator*"/>
  225. </selector>
  226. <selector id="needs.weblogic.server">
  227. <or>
  228. <filename name="${optional.package}/ejb/WLRun*"/>
  229. <filename name="${optional.package}/ejb/WLStop*"/>
  230. </or>
  231. </selector>
  232. <selector id="needs.netcomponents">
  233. <or>
  234. <filename name="${optional.package}/net/FTP*"/>
  235. <filename name="${optional.package}/net/TelnetTask*"/>
  236. </or>
  237. </selector>
  238. <selector id="needs.starteam">
  239. <or>
  240. <filename name="${optional.package}/scm/AntStarTeam*"/>
  241. <filename name="${optional.package}/starteam/*"/>
  242. </or>
  243. </selector>
  244. <selector id="needs.vaj">
  245. <filename name="${optional.package}/ide/VAJ*"/>
  246. </selector>
  247. <selector id="needs.antlr">
  248. <filename name="${optional.package}/ANTLR*"/>
  249. </selector>
  250. <selector id="needs.servletapi">
  251. <filename name="${optional.package}/ide/VAJ*Servlet*"/>
  252. </selector>
  253. <selector id="needs.jmf">
  254. <filename name="${optional.package}/sound/*"/>
  255. </selector>
  256. <selector id="needs.jai">
  257. <or>
  258. <filename name="${optional.package}/image/*"/>
  259. <filename name="${ant.package}/types/optional/image/*"/>
  260. </or>
  261. </selector>
  262. <selector id="needs.jdepend">
  263. <filename name="${optional.package}/jdepend/*"/>
  264. </selector>
  265. <selector id="needs.swing">
  266. <filename name="${optional.package}/splash/*"/>
  267. </selector>
  268. <patternset id="onlinetests">
  269. <exclude name="**/GetTest.java" if="offline"/>
  270. </patternset>
  271. <patternset id="teststhatfail">
  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"> csc.found=${csc.found}</echo>
  488. <available property="rhino.present"
  489. classname="org.mozilla.javascript.Scriptable"
  490. classpathref="classpath"/>
  491. </target>
  492. <!--
  493. ===================================================================
  494. Prepare the build
  495. ===================================================================
  496. -->
  497. <target name="prepare">
  498. <tstamp>
  499. <format property="year" pattern="yyyy"/>
  500. </tstamp>
  501. <filterchain id="ant.filters">
  502. <replacetokens>
  503. <token key="VERSION" value="${version}"/>
  504. <token key="DATE" value="${TODAY}"/>
  505. <token key="TIME" value="${TSTAMP}"/>
  506. </replacetokens>
  507. </filterchain>
  508. </target>
  509. <!--
  510. ===================================================================
  511. Build the code
  512. ===================================================================
  513. -->
  514. <target name="build"
  515. depends="prepare, check_for_optional_packages"
  516. description="--> compiles the source code">
  517. <mkdir dir="${build.dir}"/>
  518. <mkdir dir="${build.classes}"/>
  519. <mkdir dir="${build.lib}"/>
  520. <javac srcdir="${java.dir}"
  521. destdir="${build.classes}"
  522. debug="${debug}"
  523. deprecation="${deprecation}"
  524. target="${javac.target}"
  525. optimize="${optimize}" >
  526. <classpath refid="classpath"/>
  527. <selector id="conditional-patterns">
  528. <not>
  529. <or>
  530. <selector refid="needs.jdk1.2+" unless="jdk1.2+"/>
  531. <selector refid="needs.jdk1.3+" unless="jdk1.3+"/>
  532. <selector refid="needs.jdk1.4+" unless="jdk1.4+"/>
  533. <selector refid="needs.sun.tools" unless="sun.tools.present"/>
  534. <selector refid="needs.sun.uue" unless="sunuue.present"/>
  535. <selector refid="needs.sun.b64" unless="base64.present"/>
  536. <selector refid="needs.trax" unless="trax.present"/>
  537. <selector refid="needs.xalan1" unless="xalan.present"/>
  538. <selector refid="needs.xalan2" unless="xalan2.present"/>
  539. <selector refid="needs.xslp" unless="xslp.present"/>
  540. <selector refid="needs.apache.resolver" unless="apache.resolver.present"/>
  541. <selector refid="needs.junit" unless="junit.present"/>
  542. <selector refid="needs.jakarta.regexp"
  543. unless="jakarta.regexp.present"/>
  544. <selector refid="needs.jakarta.oro" unless="jakarta.oro.present"/>
  545. <selector refid="needs.jakarta.bcel" unless="bcel.present"/>
  546. <selector refid="needs.jakarta.log4j" unless="log4j.present"/>
  547. <selector refid="needs.commons.logging"
  548. unless="commons.logging.present"/>
  549. <selector refid="needs.bsf" unless="bsf.present"/>
  550. <selector refid="needs.stylebook" unless="stylebook.present"/>
  551. <selector refid="needs.javamail" unless="javamail.complete"/>
  552. <selector refid="needs.icontract" unless="icontract.present"/>
  553. <selector refid="needs.netrexx" unless="netrexx.present"/>
  554. <selector refid="needs.weblogic.ejbc" unless="ejb.ejbc.present"/>
  555. <selector refid="needs.weblogic.ddcreator"
  556. unless="ejb.DDCreator.present"/>
  557. <selector refid="needs.weblogic.server" unless="ejb.wls.present"/>
  558. <selector refid="needs.netcomponents" unless="netcomp.present"/>
  559. <selector refid="needs.starteam" unless="starteam.present"/>
  560. <selector refid="needs.vaj" unless="vaj.present"/>
  561. <selector refid="needs.antlr" unless="antlr.present"/>
  562. <selector refid="needs.servletapi" unless="servlet.present"/>
  563. <selector refid="needs.jmf" unless="jmf.present"/>
  564. <selector refid="needs.jai" unless="jai.present"/>
  565. <selector refid="needs.jdepend" unless="jdepend.present"/>
  566. <selector refid="needs.swing" unless="swing.present"/>
  567. </or>
  568. </not>
  569. </selector>
  570. </javac>
  571. <copy todir="${build.classes}">
  572. <fileset dir="${java.dir}">
  573. <include name="**/*.properties"/>
  574. <include name="**/*.dtd"/>
  575. </fileset>
  576. </copy>
  577. <copy todir="${build.classes}"
  578. overwrite="true">
  579. <fileset dir="${java.dir}">
  580. <include name="**/version.txt"/>
  581. <include name="**/defaultManifest.mf"/>
  582. </fileset>
  583. <filterchain refid="ant.filters"/>
  584. </copy>
  585. <copy todir="${build.classes}/${optional.package}/junit/xsl">
  586. <fileset dir="${etc.dir}">
  587. <include name="junit-frames.xsl"/>
  588. <include name="junit-noframes.xsl"/>
  589. </fileset>
  590. </copy>
  591. </target>
  592. <!--
  593. ===================================================================
  594. Create the Apache Ant jars: ant.jar and optional.jar
  595. ===================================================================
  596. -->
  597. <target name="jars"
  598. depends="build"
  599. description="--> creates the Apache Ant jars">
  600. <copy todir="${build.dir}">
  601. <fileset dir=".">
  602. <include name="LICENSE"/>
  603. <include name="LICENSE.xerces"/>
  604. <include name="LICENSE.dom"/>
  605. <include name="LICENSE.sax"/>
  606. </fileset>
  607. <mapper type="glob" from="*" to="*.txt"/>
  608. </copy>
  609. <copy file="${manifest}" tofile="${manifest.tmp}"/>
  610. <manifest file="${manifest.tmp}">
  611. <section name="${optional.package}/">
  612. <attribute name="Extension-name"
  613. value="org.apache.tools.ant"/>
  614. <attribute name="Specification-Title"
  615. value="Apache Ant"/>
  616. <attribute name="Specification-Version"
  617. value="${manifest-version}"/>
  618. <attribute name="Specification-Vendor"
  619. value="Apache Software Foundation"/>
  620. <attribute name="Implementation-Title"
  621. value="org.apache.tools.ant"/>
  622. <attribute name="Implementation-Version"
  623. value="${manifest-version}"/>
  624. <attribute name="Implementation-Vendor"
  625. value="Apache Software Foundation"/>
  626. </section>
  627. </manifest>
  628. <jar destfile="${build.lib}/${name}.jar"
  629. basedir="${build.classes}"
  630. manifest="${manifest}">
  631. <not>
  632. <selector id="non-core">
  633. <or>
  634. <filename name="${optional.package}/**"/>
  635. <filename name="${optional.type.package}/**"/>
  636. <filename name="${util.package}/depend/**"/>
  637. <filename name="${util.package}/optional/**"/>
  638. <selector refid="needs.jakarta.log4j"/>
  639. <selector refid="needs.commons.logging"/>
  640. <selector refid="needs.jakarta.regexp"/>
  641. <selector refid="needs.jakarta.oro"/>
  642. <selector refid="needs.jdk1.4+"/>
  643. <selector refid="needs.javamail"/>
  644. </or>
  645. </selector>
  646. </not>
  647. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  648. <manifest>
  649. <section name="${ant.package}/">
  650. <attribute name="Extension-name"
  651. value="org.apache.tools.ant"/>
  652. <attribute name="Specification-Title"
  653. value="Apache Ant"/>
  654. <attribute name="Specification-Version"
  655. value="${manifest-version}"/>
  656. <attribute name="Specification-Vendor"
  657. value="Apache Software Foundation"/>
  658. <attribute name="Implementation-Title"
  659. value="org.apache.tools.ant"/>
  660. <attribute name="Implementation-Version"
  661. value="${manifest-version}"/>
  662. <attribute name="Implementation-Vendor"
  663. value="Apache Software Foundation"/>
  664. </section>
  665. </manifest>
  666. <fileset dir="${docs.dir}">
  667. <include name="images/ant_logo_large.gif"/>
  668. </fileset>
  669. </jar>
  670. <jar destfile="${build.lib}/optional.jar"
  671. basedir="${build.classes}"
  672. manifest="${manifest.tmp}">
  673. <selector refid="non-core"/>
  674. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  675. </jar>
  676. <jar destfile="${build.lib}/${bootstrap.jar}"
  677. basedir="${build.classes}"
  678. manifest="${manifest}">
  679. <include name="${ant.package}/Main.class"/>
  680. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  681. <manifest>
  682. <attribute name="Class-Path"
  683. value="ant.jar xml-apis.jar xercesImpl.jar optional.jar xalan.jar"/>
  684. </manifest>
  685. </jar>
  686. <jar destfile="${build.lib}/nodeps.jar"
  687. basedir="${build.classes}"
  688. manifest="${manifest.tmp}">
  689. <and>
  690. <selector refid="non-core"/>
  691. <not>
  692. <or>
  693. <selector refid="needs.trax"/>
  694. <selector refid="needs.xalan1"/>
  695. <selector refid="needs.xalan2"/>
  696. <selector refid="needs.xslp"/>
  697. <selector refid="needs.apache.resolver"/>
  698. <selector refid="needs.junit"/>
  699. <selector refid="needs.jakarta.regexp"/>
  700. <selector refid="needs.jakarta.oro"/>
  701. <selector refid="needs.jakarta.bcel"/>
  702. <selector refid="needs.jakarta.log4j"/>
  703. <selector refid="needs.commons.logging"/>
  704. <selector refid="needs.bsf"/>
  705. <selector refid="needs.stylebook"/>
  706. <selector refid="needs.javamail"/>
  707. <selector refid="needs.icontract"/>
  708. <selector refid="needs.netrexx"/>
  709. <selector refid="needs.weblogic.ejbc"/>
  710. <selector refid="needs.weblogic.ddcreator"/>
  711. <selector refid="needs.weblogic.server"/>
  712. <selector refid="needs.netcomponents"/>
  713. <selector refid="needs.starteam"/>
  714. <selector refid="needs.vaj"/>
  715. <selector refid="needs.antlr"/>
  716. <selector refid="needs.servletapi"/>
  717. <selector refid="needs.jmf"/>
  718. <selector refid="needs.jai"/>
  719. <selector refid="needs.jdepend"/>
  720. <selector refid="needs.swing"/>
  721. </or>
  722. </not>
  723. </and>
  724. <metainf dir="${build.dir}" includes="LICENSE.txt"/>
  725. </jar>
  726. <jar destfile="${build.lib}/${optional.jars.prefix}-trax.jar"
  727. basedir="${build.classes}"
  728. manifest="${manifest.tmp}">
  729. <selector refid="needs.trax"/>
  730. </jar>
  731. <jar destfile="${build.lib}/${optional.jars.prefix}-xalan1.jar"
  732. basedir="${build.classes}"
  733. manifest="${manifest.tmp}">
  734. <selector refid="needs.xalan1"/>
  735. </jar>
  736. <jar destfile="${build.lib}/${optional.jars.prefix}-xalan2.jar"
  737. basedir="${build.classes}"
  738. manifest="${manifest.tmp}">
  739. <selector refid="needs.xalan2"/>
  740. </jar>
  741. <jar destfile="${build.lib}/${optional.jars.prefix}-xslp.jar"
  742. basedir="${build.classes}"
  743. manifest="${manifest.tmp}">
  744. <selector refid="needs.xslp"/>
  745. </jar>
  746. <jar destfile="${build.lib}/${optional.jars.prefix}-apache-resolver.jar"
  747. basedir="${build.classes}"
  748. manifest="${manifest.tmp}">
  749. <selector refid="needs.apache.resolver"/>
  750. </jar>
  751. <jar destfile="${build.lib}/${optional.jars.prefix}-junit.jar"
  752. basedir="${build.classes}"
  753. manifest="${manifest.tmp}">
  754. <selector refid="needs.junit"/>
  755. </jar>
  756. <jar destfile="${build.lib}/${optional.jars.prefix}-jakarta-regexp.jar"
  757. basedir="${build.classes}" manifest="${manifest.tmp}">
  758. <selector refid="needs.jakarta.regexp"/>
  759. </jar>
  760. <jar destfile="${build.lib}/${optional.jars.prefix}-oro.jar"
  761. basedir="${build.classes}"
  762. manifest="${manifest.tmp}">
  763. <selector refid="needs.jakarta.oro"/>
  764. </jar>
  765. <jar destfile="${build.lib}/${optional.jars.prefix}-bcel.jar"
  766. basedir="${build.classes}"
  767. manifest="${manifest.tmp}">
  768. <selector refid="needs.jakarta.bcel"/>
  769. </jar>
  770. <jar destfile="${build.lib}/${optional.jars.prefix}-log4j.jar"
  771. basedir="${build.classes}"
  772. manifest="${manifest.tmp}">
  773. <selector refid="needs.jakarta.log4j"/>
  774. </jar>
  775. <jar destfile="${build.lib}/${optional.jars.prefix}-commons-logging.jar"
  776. basedir="${build.classes}" manifest="${manifest.tmp}">
  777. <selector refid="needs.commons.logging"/>
  778. </jar>
  779. <jar destfile="${build.lib}/${optional.jars.prefix}-apache-bsf.jar"
  780. basedir="${build.classes}"
  781. manifest="${manifest.tmp}">
  782. <selector refid="needs.bsf"/>
  783. </jar>
  784. <jar destfile="${build.lib}/${optional.jars.prefix}-stylebook.jar"
  785. basedir="${build.classes}"
  786. manifest="${manifest.tmp}">
  787. <selector refid="needs.stylebook"/>
  788. </jar>
  789. <jar destfile="${build.lib}/${optional.jars.prefix}-javamail.jar"
  790. basedir="${build.classes}"
  791. manifest="${manifest.tmp}">
  792. <selector refid="needs.javamail"/>
  793. </jar>
  794. <jar destfile="${build.lib}/${optional.jars.prefix}-icontract.jar"
  795. basedir="${build.classes}"
  796. manifest="${manifest.tmp}">
  797. <selector refid="needs.icontract"/>
  798. </jar>
  799. <jar destfile="${build.lib}/${optional.jars.prefix}-netrexx.jar"
  800. basedir="${build.classes}"
  801. manifest="${manifest.tmp}">
  802. <selector refid="needs.netrexx"/>
  803. </jar>
  804. <jar destfile="${build.lib}/${optional.jars.prefix}-netcomp.jar"
  805. basedir="${build.classes}"
  806. manifest="${manifest.tmp}">
  807. <selector refid="needs.netcomponents"/>
  808. </jar>
  809. <jar destfile="${build.lib}/${optional.jars.prefix}-starteam.jar"
  810. basedir="${build.classes}"
  811. manifest="${manifest.tmp}">
  812. <selector refid="needs.starteam"/>
  813. </jar>
  814. <jar destfile="${build.lib}/${optional.jars.prefix}-vaj.jar"
  815. basedir="${build.classes}"
  816. manifest="${manifest.tmp}">
  817. <selector refid="needs.vaj"/>
  818. </jar>
  819. <jar destfile="${build.lib}/${optional.jars.prefix}-antlr.jar"
  820. basedir="${build.classes}"
  821. manifest="${manifest.tmp}">
  822. <selector refid="needs.antlr"/>
  823. </jar>
  824. <jar destfile="${build.lib}/${optional.jars.prefix}-jmf.jar"
  825. basedir="${build.classes}"
  826. manifest="${manifest.tmp}">
  827. <selector refid="needs.jmf"/>
  828. </jar>
  829. <jar destfile="${build.lib}/${optional.jars.prefix}-jai.jar"
  830. basedir="${build.classes}"
  831. manifest="${manifest.tmp}">
  832. <selector refid="needs.jai"/>
  833. </jar>
  834. <jar destfile="${build.lib}/${optional.jars.prefix}-swing.jar"
  835. basedir="${build.classes}"
  836. manifest="${manifest.tmp}">
  837. <selector refid="needs.swing"/>
  838. </jar>
  839. <jar destfile="${build.lib}/${optional.jars.prefix}-jdepend.jar"
  840. basedir="${build.classes}"
  841. manifest="${manifest.tmp}">
  842. <selector refid="needs.jdepend"/>
  843. </jar>
  844. <jar destfile="${build.lib}/${optional.jars.prefix}-weblogic.jar"
  845. basedir="${build.classes}"
  846. manifest="${manifest.tmp}">
  847. <or>
  848. <selector refid="needs.weblogic.ejbc"/>
  849. <selector refid="needs.weblogic.ddcreator" />
  850. <selector refid="needs.weblogic.server"/>
  851. </or>
  852. </jar>
  853. </target>
  854. <!-- Creates jar of test utility classes -->
  855. <target name="test-jar"
  856. depends="compile-tests"
  857. description="--> creates the Apache Ant Test Utilties jar">
  858. <jar destfile="${build.lib}/${name}-testutil.jar"
  859. basedir="${build.tests}">
  860. <patternset refid="useful.tests"/>
  861. </jar>
  862. </target>
  863. <!--
  864. ===================================================================
  865. Create the essential distribution that can run Apache Ant
  866. ===================================================================
  867. -->
  868. <target name="dist-lite"
  869. depends="jars"
  870. description="--> creates a minimum distribution to run Apache Ant">
  871. <mkdir dir="${dist.dir}"/>
  872. <mkdir dir="${dist.bin}"/>
  873. <mkdir dir="${dist.lib}"/>
  874. <copy todir="${dist.lib}">
  875. <fileset dir="${build.lib}">
  876. <exclude name="${bootstrap.jar}"/>
  877. </fileset>
  878. </copy>
  879. <copy todir="${dist.bin}">
  880. <fileset dir="${script.dir}/"/>
  881. </copy>
  882. <fixcrlf srcdir="${dist.bin}" eol="crlf" includes="*.bat"/>
  883. <fixcrlf srcdir="${dist.bin}" eol="lf">
  884. <include name="ant"/>
  885. <include name="antRun"/>
  886. <include name="*.pl"/>
  887. </fixcrlf>
  888. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  889. failonerror="${chmod.fail}"/>
  890. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  891. failonerror="${chmod.fail}"/>
  892. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  893. <fileset dir="${dist.bin}">
  894. <include name="**/ant"/>
  895. <include name="**/antRun"/>
  896. <include name="**/*.pl"/>
  897. <include name="**/*.py"/>
  898. </fileset>
  899. </chmod>
  900. </target>
  901. <!--
  902. ===================================================================
  903. Create the complete distribution
  904. ===================================================================
  905. -->
  906. <target name="dist" description="--> creates a complete distribution">
  907. <antcall inheritAll="false" target="internal_dist">
  908. <param name="dist.dir" value="${dist.name}"/>
  909. </antcall>
  910. </target>
  911. <target name="dist_javadocs" depends="javadocs">
  912. <mkdir dir="${dist.javadocs}"/>
  913. <copy todir="${dist.javadocs}" overwrite="true">
  914. <fileset dir="${build.javadocs}"/>
  915. </copy>
  916. </target>
  917. <target name="internal_dist" depends="dist-lite,dist_javadocs">
  918. <mkdir dir="${dist.docs}"/>
  919. <mkdir dir="${dist.etc}"/>
  920. <copy todir="${dist.lib}">
  921. <fileset dir="${lib.dir}">
  922. <include name="*.jar"/>
  923. <include name="*.zip"/>
  924. </fileset>
  925. </copy>
  926. <copy todir="${dist.lib}" file="${lib.dir}/README"/>
  927. <copy todir="${dist.docs}">
  928. <fileset dir="${docs.dir}" excludes="${unfiltered.files}"/>
  929. <filterchain refid="ant.filters"/>
  930. </copy>
  931. <copy todir="${dist.docs}" filtering="false">
  932. <fileset dir="${docs.dir}" includes="${unfiltered.files}"/>
  933. </copy>
  934. <copy todir="${dist.dir}">
  935. <fileset dir=".">
  936. <include name="README"/>
  937. <include name="LICENSE"/>
  938. <include name="LICENSE.xerces"/>
  939. <include name="LICENSE.dom"/>
  940. <include name="LICENSE.sax"/>
  941. <include name="TODO"/>
  942. <include name="WHATSNEW"/>
  943. <include name="KEYS"/>
  944. <include name="welcome.html"/>
  945. </fileset>
  946. </copy>
  947. <chmod perm="ugo+rx" dir="${dist.dir}" type="dir" includes="**"
  948. failonerror="${chmod.fail}"/>
  949. <chmod perm="ugo+r" dir="${dist.dir}" type="file" includes="**"
  950. failonerror="${chmod.fail}"/>
  951. <chmod perm="ugo+x" type="file" failonerror="${chmod.fail}">
  952. <fileset dir="${dist.bin}">
  953. <include name="**/ant"/>
  954. <include name="**/antRun"/>
  955. <include name="**/*.pl"/>
  956. <include name="**/*.py"/>
  957. </fileset>
  958. </chmod>
  959. <!-- publish some useful stylesheets -->
  960. <copy todir="${dist.etc}">
  961. <fileset dir="${etc.dir}">
  962. <include name="junit-frames.xsl"/>
  963. <include name="junit-noframes.xsl"/>
  964. <include name="coverage-frames.xsl"/>
  965. <include name="maudit-frames.xsl"/>
  966. <include name="mmetrics-frames.xsl"/>
  967. <include name="changelog.xsl"/>
  968. <include name="jdepend.xsl"/>
  969. <include name="jdepend-frames.xsl"/>
  970. <include name="checkstyle-frames.xsl"/>
  971. <include name="log.xsl"/>
  972. <include name="tagdiff.xsl"/>
  973. </fileset>
  974. <fileset dir="${build.lib}">
  975. <include name="${bootstrap.jar}"/>
  976. </fileset>
  977. </copy>
  978. </target>
  979. <!--
  980. ===================================================================
  981. Target to create bootstrap build
  982. ===================================================================
  983. -->
  984. <target name="bootstrap" description="--> creates a bootstrap build">
  985. <antcall inheritAll="false" target="dist-lite">
  986. <param name="dist.dir" value="${bootstrap.dir}"/>
  987. </antcall>
  988. </target>
  989. <!--
  990. ===================================================================
  991. Create the source distribution
  992. ===================================================================
  993. -->
  994. <target name="src-dist"
  995. description="--> creates a source distribution">
  996. <mkdir dir="${src.dist.dir}"/>
  997. <copy todir="${src.dist.lib}">
  998. <fileset dir="${lib.dir}">
  999. <include name="*.jar"/>
  1000. <include name="*.zip"/>
  1001. <include name="README"/>
  1002. </fileset>
  1003. </copy>
  1004. <copy todir="${src.dist.src}">
  1005. <fileset dir="${src.dir}"/>
  1006. </copy>
  1007. <copy todir="${src.dist.docs}">
  1008. <fileset dir="${docs.dir}">
  1009. <exclude name="manual/api/**"/>
  1010. </fileset>
  1011. </copy>
  1012. <copy todir="${src.dist.dir}">
  1013. <fileset dir=".">
  1014. <include name="README"/>
  1015. <include name="LICENSE"/>
  1016. <include name="LICENSE.xerces"/>
  1017. <include name="LICENSE.dom"/>
  1018. <include name="LICENSE.sax"/>
  1019. <include name="TODO"/>
  1020. <include name="WHATSNEW"/>
  1021. <include name="KEYS"/>
  1022. <include name="build.bat"/>
  1023. <include name="build.sh"/>
  1024. <include name="bootstrap.bat"/>
  1025. <include name="bootstrap.sh"/>
  1026. <include name="build.xml"/>
  1027. <include name="welcome.html"/>
  1028. </fileset>
  1029. </copy>
  1030. <fixcrlf srcdir="${src.dist.dir}" eol="crlf" includes="*.bat"/>
  1031. <fixcrlf srcdir="${src.dist.dir}" eol="lf">
  1032. <include name="**/*.sh"/>
  1033. <include name="**/*.pl"/>
  1034. <include name="**/ant"/>
  1035. <include name="**/antRun"/>
  1036. </fixcrlf>
  1037. <fixcrlf srcdir="${src.dist.dir}">
  1038. <include name="**/*.java"/>
  1039. </fixcrlf>
  1040. <chmod perm="ugo+x" dir="${src.dist.dir}" type="dir"
  1041. failonerror="${chmod.fail}"/>
  1042. <chmod perm="ugo+r" dir="${src.dist.dir}" failonerror="${chmod.fail}"/>
  1043. <chmod perm="ugo+x" failonerror="${chmod.fail}">
  1044. <fileset dir="${src.dist.dir}">
  1045. <include name="**/.sh"/>
  1046. <include name="**/.pl"/>
  1047. <include name="**/.py"/>
  1048. <include name="**/ant"/>
  1049. <include name="**/antRun"/>
  1050. </fileset>
  1051. </chmod>
  1052. </target>
  1053. <!--
  1054. ===================================================================
  1055. Create the binary distribution
  1056. ===================================================================
  1057. -->
  1058. <target name="main_distribution"
  1059. description="--> creates the zip and tar distributions">
  1060. <delete dir="${dist.name}"/>
  1061. <mkdir dir="${dist.base}"/>
  1062. <mkdir dir="${dist.base}/src"/>
  1063. <mkdir dir="${dist.base}/bin"/>
  1064. <antcall inheritAll="false" target="internal_dist">
  1065. <param name="dist.dir" value="${dist.name}"/>
  1066. </antcall>
  1067. <zip destfile="${dist.base}/bin/${dist.name}-bin.zip"
  1068. basedir="${dist.name}/.."
  1069. includes="${dist.name}/**"/>
  1070. <tar longfile="gnu"
  1071. destfile="${dist.base}/bin/${dist.name}-bin.tar">
  1072. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  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. </tarfileset>
  1078. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  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. </tarfileset>
  1085. </tar>
  1086. <gzip zipfile="${dist.base}/bin/${dist.name}-bin.tar.gz"
  1087. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  1088. <bzip2 zipfile="${dist.base}/bin/${dist.name}-bin.tar.bz2"
  1089. src="${dist.base}/bin/${dist.name}-bin.tar"/>
  1090. <delete file="${dist.base}/bin/${dist.name}-bin.tar"/>
  1091. <delete dir="${dist.name}"/>
  1092. <checksum fileext=".md5">
  1093. <fileset dir="${dist.base}/bin/">
  1094. <include name="**/*"/>
  1095. <exclude name="**/*.asc"/>
  1096. <exclude name="**/*.md5"/>
  1097. </fileset>
  1098. </checksum>
  1099. <antcall inheritAll="false" target="src-dist">
  1100. <param name="src.dist.dir" value="${dist.name}"/>
  1101. </antcall>
  1102. <zip destfile="${dist.base}/src/${dist.name}-src.zip"
  1103. basedir="${dist.name}/.."
  1104. includes="${dist.name}/**"/>
  1105. <tar longfile="gnu"
  1106. destfile="${dist.base}/src/${dist.name}-src.tar" >
  1107. <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
  1108. <include name="${dist.name}/bootstrap.sh"/>
  1109. <include name="${dist.name}/build.sh"/>
  1110. </tarfileset>
  1111. <tarfileset dir="${dist.name}/.." username="ant" group="ant">
  1112. <include name="${dist.name}/**"/>
  1113. <exclude name="${dist.name}/bootstrap.sh"/>
  1114. <exclude name="${dist.name}/build.sh"/>
  1115. </tarfileset>
  1116. </tar>
  1117. <gzip zipfile="${dist.base}/src/${dist.name}-src.tar.gz"
  1118. src="${dist.base}/src/${dist.name}-src.tar"/>
  1119. <bzip2 zipfile="${dist.base}/src/${dist.name}-src.tar.bz2"
  1120. src="${dist.base}/src/${dist.name}-src.tar"/>
  1121. <delete file="${dist.base}/src/${dist.name}-src.tar"/>
  1122. <delete dir="${dist.name}"/>
  1123. <checksum fileext=".md5">
  1124. <fileset dir="${dist.base}/src/">
  1125. <include name="**/*"/>
  1126. <exclude name="**/*.asc"/>
  1127. <exclude name="**/*.md5"/>
  1128. </fileset>
  1129. </checksum>
  1130. </target>
  1131. <target name="distribution" depends="main_distribution"
  1132. description="--> creates the full Apache Ant distribution">
  1133. </target>
  1134. <!--
  1135. ===================================================================
  1136. Cleans up build and distribution directories
  1137. ===================================================================
  1138. -->
  1139. <target name="clean"
  1140. description="--> cleans up build and dist directories">
  1141. <delete dir="${build.dir}"/>
  1142. <delete dir="${dist.base}"/>
  1143. <delete dir="${dist.dir}"/>
  1144. <delete>
  1145. <fileset dir="." includes="**/*~" defaultexcludes="no"/>
  1146. </delete>
  1147. </target>
  1148. <!--
  1149. ===================================================================
  1150. Cleans everything
  1151. ===================================================================
  1152. -->
  1153. <target name="allclean"
  1154. depends="clean"
  1155. description="--> cleans up everything">
  1156. <delete file="${bootstrap.dir}/bin/antRun"/>
  1157. <delete file="${bootstrap.dir}/bin/antRun.bat"/>
  1158. <delete file="${bootstrap.dir}/bin/*.pl"/>
  1159. <delete file="${bootstrap.dir}/bin/*.py"/>
  1160. </target>
  1161. <!--
  1162. ===================================================================
  1163. Installs Apache Ant
  1164. ===================================================================
  1165. -->
  1166. <target name="install" if="ant.install">
  1167. <antcall inheritAll="false" target="internal_dist">
  1168. <param name="dist.dir" value="${ant.install}"/>
  1169. </antcall>
  1170. </target>
  1171. <target name="install-lite" if="ant.install">
  1172. <antcall inheritAll="false" target="dist-lite">
  1173. <param name="dist.dir" value="${ant.install}"/>
  1174. </antcall>
  1175. </target>
  1176. <!--
  1177. ===================================================================
  1178. Creates the API documentation
  1179. ===================================================================
  1180. -->
  1181. <target name="javadoc_check">
  1182. <uptodate property="javadoc.notrequired"
  1183. targetfile="${build.javadocs}/packages.html" >
  1184. <srcfiles dir= "${java.dir}" includes="**/*.java"/>
  1185. </uptodate>
  1186. <uptodate property="tests.javadoc.notrequired"
  1187. targetfile="${build.tests.javadocs}/packages.html" >
  1188. <srcfiles dir= "${tests.dir}">
  1189. <patternset refid="useful.tests"/>
  1190. </srcfiles>
  1191. </uptodate>
  1192. </target>
  1193. <target name="javadocs" depends="prepare, javadoc_check"
  1194. unless="javadoc.notrequired"
  1195. description="--> creates the API documentation">
  1196. <mkdir dir="${build.javadocs}"/>
  1197. <javadoc useexternalfile="yes"
  1198. destdir="${build.javadocs}"
  1199. author="true"
  1200. version="true"
  1201. locale="en"
  1202. windowtitle="${Name} API"
  1203. doctitle="${Name}">
  1204. <packageset dir="${java.dir}"/>
  1205. <tag name="todo" description="To do:" scope="all"/>
  1206. <tag name="ant.task" enabled="false" description="Task:" scope="types"/>
  1207. <tag name="ant.datatype" enabled="false" description="Data type:" scope="types"/>
  1208. <group title="Apache Ant Core" packages="org.apache.tools.ant*"/>
  1209. <group title="Core Tasks" packages="org.apache.tools.ant.taskdefs*"/>
  1210. <group title="Core Types" packages="org.apache.tools.ant.types*"/>
  1211. <group title="Optional Tasks" packages="org.apache.tools.ant.taskdefs.optional*"/>
  1212. <group title="Optional Types" packages="org.apache.tools.ant.types.optional*"/>
  1213. <group title="Ant Utilities" packages="org.apache.tools.ant.util*"/>
  1214. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1215. </javadoc>
  1216. </target>
  1217. <target name="test-javadocs" depends="prepare, javadoc_check"
  1218. unless="tests.javadoc.notrequired"
  1219. description="--> creates the API documentation for test utilities">
  1220. <mkdir dir="${build.tests.javadocs}"/>
  1221. <javadoc useexternalfile="yes"
  1222. destdir="${build.tests.javadocs}"
  1223. author="true"
  1224. version="true"
  1225. locale="en"
  1226. windowtitle="${Name} Test Utilities"
  1227. doctitle="${Name}">
  1228. <fileset dir="${tests.dir}">
  1229. <patternset refid="useful.tests"/>
  1230. </fileset>
  1231. <bottom>Copyright &#169; 2000-${year} Apache Software Foundation. All Rights Reserved.</bottom>
  1232. </javadoc>
  1233. </target>
  1234. <!--
  1235. ===================================================================
  1236. Compile testcases
  1237. ===================================================================
  1238. -->
  1239. <target name="compile-tests" depends="build" if="junit.present">
  1240. <mkdir dir="${build.tests}"/>
  1241. <javac srcdir="${tests.dir}"
  1242. destdir="${build.tests}"
  1243. debug="${debug}"
  1244. target="${javac.target}"
  1245. deprecation="${deprecation}" >
  1246. <classpath refid="tests-classpath"/>
  1247. <selector refid="conditional-patterns"/>
  1248. </javac>
  1249. </target>
  1250. <target name="dump-info" depends="dump-sys-properties,run-which"/>
  1251. <target name="dump-sys-properties" unless="which.present"
  1252. depends="xml-check">
  1253. <echo message="java.vm.info=${java.vm.info}"/>
  1254. <echo message="java.vm.name=${java.vm.name}"/>
  1255. <echo message="java.vm.vendor=${java.vm.vendor}"/>
  1256. <echo message="java.vm.version=${java.vm.version}"/>
  1257. <echo message="os.arch=${os.arch}"/>
  1258. <echo message="os.name=${os.name}"/>
  1259. <echo message="os.version=${os.version}"/>
  1260. <echo message="file.encoding=${file.encoding}"/>
  1261. <echo message="user.language=${user.language}"/>
  1262. </target>
  1263. <!-- helper class from Xalan2 to check for jar versioning of xml/xsl processors -->
  1264. <target name="xml-check" depends="check_for_optional_packages"
  1265. if="xalan.envcheck" unless="which.present">
  1266. <java classname="org.apache.xalan.xslt.EnvironmentCheck"/>
  1267. </target>
  1268. <target name="run-which" depends="check_for_optional_packages"
  1269. if="which.present">
  1270. <java classname="org.apache.env.Which" taskname="which"/>
  1271. </target>
  1272. <!-- test to see if we are online or not. can take a while when we are off line, so
  1273. setting the property is a good shortcut-->
  1274. <target name="probe-offline">
  1275. <condition property="offline">
  1276. <or>
  1277. <isset property="offline"/>
  1278. <not>
  1279. <http url="http://www.apache.org/"/>
  1280. </not>
  1281. </or>
  1282. </condition>
  1283. <echo level="verbose" > offline=${offline}</echo>
  1284. </target>
  1285. <!--
  1286. ===================================================================
  1287. Run testcase
  1288. ===================================================================
  1289. -->
  1290. <target name="test" depends="run-tests" description="--> run JUnit tests"/>
  1291. <target name="run-tests" depends="dump-info,compile-tests,probe-offline" if="junit.present">
  1292. <condition property="run.junitreport">
  1293. <or>
  1294. <isset property="xalan2.present"/>
  1295. <and>
  1296. <isset property="xalan.present"/>
  1297. <isset property="bsf.present"/>
  1298. </and>
  1299. </or>
  1300. </condition>
  1301. <junit printsummary="${junit.summary}" haltonfailure="${test.haltonfailure}"
  1302. filtertrace="${junit.filtertrace}"
  1303. fork="${junit.fork}">
  1304. <!-- <jvmarg value="-classic"/> -->
  1305. <classpath refid="tests-classpath"/>
  1306. <classpath refid="classes.zip"/>
  1307. <sysproperty key="ant.home" value="${ant.home}"/>
  1308. <sysproperty key="build.tests" value="${build.tests}"/>
  1309. <sysproperty key="tests-classpath.value"
  1310. value="${tests-classpath.value}"/>
  1311. <formatter type="brief" usefile="false"/>
  1312. <batchtest>
  1313. <fileset dir="${tests.dir}">
  1314. <include name="**/*Test*"/>
  1315. <!-- abstract classes, not testcases -->
  1316. <exclude name="${ant.package}/taskdefs/TaskdefsTest.java"/>
  1317. <exclude name="${ant.package}/BuildFileTest.java"/>
  1318. <exclude name="${regexp.package}/RegexpMatcherTest.java"/>
  1319. <exclude name="${regexp.package}/RegexpTest.java"/>
  1320. <exclude name="${optional.package}/AbstractXSLTLiaisonTest.java"/>
  1321. <exclude name="${ant.package}/types/AbstractFileSetTest.java"/>
  1322. <exclude name="${ant.package}/types/selectors/BaseSelectorTest.java"/>
  1323. <!-- helper classes, not testcases -->
  1324. <exclude name="org/example/**"/>
  1325. <exclude name="${ant.package}/taskdefs/TaskdefTest*Task.java"/>
  1326. <!-- interactive test -->
  1327. <exclude name="${ant.package}/taskdefs/TestProcess.java"/>
  1328. <!-- only run these tests if their required libraries are
  1329. installed -->
  1330. <selector refid="conditional-patterns"/>
  1331. <!-- fails under 1.1 -->
  1332. <exclude name="${optional.package}/perforce/P4ChangeTest.java"
  1333. unless="jdk1.2+"/>
  1334. <!-- tests excluded if the test is run in offline mode -->
  1335. <patternset refid="onlinetests"/>
  1336. <!-- failing tests excluded unless run.failing.tests is set -->
  1337. <patternset refid="teststhatfail"/>
  1338. <!-- runtime dependencies that are different from compile
  1339. time dependencies -->
  1340. <exclude name="${optional.package}/ReplaceRegExpTest.java"
  1341. unless="some.regexp.support"/>
  1342. <exclude name="${optional.package}/sitraka/*.java"
  1343. unless="some.regexp.support"/>
  1344. <exclude name="${optional.package}/RhinoScriptTest.java"
  1345. unless="bsf.present"/>
  1346. <exclude name="${optional.package}/RhinoScriptTest.java"
  1347. unless="rhino.present"/>
  1348. <!-- fail if testcases can be loaded from the system classloader -->
  1349. <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java"
  1350. if="tests.are.on.system.classpath"/>
  1351. <exclude name="${optional.package}/sitraka/XMLReportTest.java"
  1352. if="tests.are.on.system.classpath"/>
  1353. <!-- these tests need to be localised before being ran???? -->
  1354. <exclude name="${optional.package}/PvcsTest.java"/>
  1355. <!-- These tests need a TraX implementation like xalan2 or saxon -->
  1356. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1357. unless="trax.impl.present"/>
  1358. <exclude name="${optional.package}/XsltTest.java"
  1359. unless="trax.impl.present"/>
  1360. <exclude name="${ant.package}/types/XMLCatalogBuildFileTest.java"
  1361. unless="trax.impl.present"/>
  1362. <exclude name="${optional.package}/junit/JUnitReportTest.java"
  1363. unless="run.junitreport"/>
  1364. <!-- needs BSF to work -->
  1365. <exclude name="${optional.package}/XalanLiaisonTest.java"
  1366. unless="bsf.present"/>
  1367. <!--
  1368. XXX need to figure out what's causing this InvocationTargetException
  1369. -->
  1370. <exclude name="${optional.package}/junit/JUnitTestRunnerTest.java"
  1371. unless="jdk1.2+"/>
  1372. <!-- DateTime handling seems to be broken in JDK 1.1 -->
  1373. <exclude name="${util.package}/DateUtilsTest.java"
  1374. unless="jdk1.2+"/>
  1375. <exclude name="${optional.package}/JspcTest.java"/>
  1376. <!-- misc oneoff tests -->
  1377. <exclude name="${optional.package}/WsdlToDotnetTest.java"
  1378. unless="dotnetapps.found"/>
  1379. <!-- These tests only passes if testcases and Ant classes have
  1380. been loaded by the same classloader - will throw
  1381. IllegalAccessExceptions otherwise. -->
  1382. <exclude name="${ant.package}/taskdefs/SQLExecTest.java"
  1383. unless="tests.and.ant.share.classloader"/>
  1384. <exclude name="${optional.package}/sos/SOSTest.java"
  1385. unless="tests.and.ant.share.classloader"/>
  1386. <exclude name="${optional.package}/TraXLiaisonTest.java"
  1387. unless="tests.and.ant.share.classloader"/>
  1388. <exclude name="${optional.package}/metamata/MAuditParserTest.java"
  1389. unless="tests.and.ant.share.classloader"/>
  1390. <!-- can only run if cvs is installed on your machine
  1391. enable by setting the property have.cvs
  1392. -->
  1393. <exclude name="${ant.package}/taskdefs/AbstractCvsTaskTest.java"
  1394. unless="have.cvs"/>
  1395. </fileset>
  1396. </batchtest>
  1397. <test name="org.apache.tools.ant.taskdefs.optional.JspcTest"
  1398. if="jasper.present"/>
  1399. </junit>
  1400. </target>
  1401. <target name="run-single-test" if="testcase" depends="compile-tests,run-single-test-only"
  1402. description="--> runs the single unit test defined in the testcase property"/>
  1403. <target name="run-single-test-only"
  1404. description="--> runs the single unit test defined in the testcase property">
  1405. <junit printsummary="${junit.summary}"
  1406. haltonfailure="${test.haltonfailure}"
  1407. fork="${junit.fork}"
  1408. filtertrace="${junit.filtertrace}">
  1409. <!-- <jvmarg value="-classic"/> -->
  1410. <sysproperty key="ant.home" value="${ant.home}"/>
  1411. <sysproperty key="build.tests" value="${build.tests}"/>
  1412. <sysproperty key="tests-classpath.value"
  1413. value="${tests-classpath.value}"/>
  1414. <classpath refid="classes.zip"/>
  1415. <classpath refid="tests-classpath"/>
  1416. <formatter type="plain" usefile="false"/>
  1417. <test name="${testcase}"/>
  1418. </junit>
  1419. </target>
  1420. <target name="interactive-tests" description="--> runs interactive tests"
  1421. depends="compile-tests"
  1422. if="jdk1.3+">
  1423. <java classpathref="tests-classpath"
  1424. classname="org.apache.tools.ant.taskdefs.TestProcess"
  1425. fork="true"/>
  1426. </target>
  1427. <!--
  1428. ===================================================================
  1429. Main target - runs dist-lite by default
  1430. ===================================================================
  1431. -->
  1432. <target name="main"
  1433. description="--> creates a minimum distribution in ./dist"
  1434. depends="dist-lite"/>
  1435. </project>