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

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