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

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