You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 61 kB

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