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

build.xml 61 kB

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