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

build.xml 62 kB

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