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

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