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

build.xml 62 kB

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