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

build.xml 63 kB

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