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

build.xml 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <!-- -*- Mode: SGML; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -->
  2. <!-- ========================================================================= -->
  3. <!-- Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), -->
  4. <!-- 2004-2005 Contributors. -->
  5. <!-- All rights reserved. -->
  6. <!-- This program and the accompanying materials are made available -->
  7. <!-- under the terms of the Common Public License v1.0 -->
  8. <!-- which accompanies this distribution and is available at -->
  9. <!-- http://www.eclipse.org/legal/cpl-v10.html -->
  10. <!-- -->
  11. <!-- Contributors: -->
  12. <!-- Xerox/PARC initial implementation -->
  13. <!-- ========================================================================= -->
  14. <!DOCTYPE project [
  15. <!ENTITY build-properties SYSTEM "file:../build/build-properties.xml">
  16. ]>
  17. <project name="build-docs" default="dist" basedir=".">
  18. <property name="project.name" value="build-docs" />
  19. <target name="product" depends="local-dist" />
  20. <target name="clean"
  21. depends="clean-directories,clean-doc-directories"
  22. />
  23. <!-- ===================================================================== -->
  24. <!-- Init -->
  25. <!-- ===================================================================== -->
  26. &build-properties;
  27. <target name="init" depends="init-properties,init-directories">
  28. <property name="docs.src.pattern"
  29. value="**/*.xml,**/*.html,**/*.doc,**/*.gif,**/*.java,**/*.lst,**/*.pdf"
  30. />
  31. <property name="docs.src.dir"
  32. location="${aspectj.modules.docs.dir}"
  33. />
  34. <property name="docs.dist.dir"
  35. location="${aj.dist.dir}/docs"
  36. />
  37. <property name="docs.temp.dir"
  38. location="${aj.temp.dir}/doc"
  39. />
  40. <property name="web.doc.dir"
  41. location="${aj.webDeploy.dir}/documentation/dist"
  42. />
  43. <property name="docs.product.name"
  44. value="aspectj-docs-${build.version}"
  45. />
  46. <property name="docs.product.zip"
  47. location="${aj.dist.dir}/${docs.product.name}.zip"
  48. />
  49. <!-- must specify (not *.gif) to not delete other gifs during build-in-place -->
  50. <!-- to find refs: gp ax imagedata | sed -n 's|.*\=\"\(..*\)\".*|\1|p' -->
  51. <property name="devguide.icons.dir"
  52. location="${aspectj.modules.dir}/ajde/src/org/aspectj/ajde/resources/actions"
  53. />
  54. <property name="include.devguide.icons"
  55. value="build.gif,openConfig.gif,browseroptions.gif"
  56. />
  57. <!-- callers of xml-html use these by default -->
  58. <property name="chunk.xsl.source"
  59. location="${aspectj.modules.lib.dir}/docbook/docbook-xsl/html/chunk.xsl"
  60. />
  61. <property name="nochunk.xsl.source"
  62. location="${aspectj.modules.lib.dir}/docbook/docbook-xsl/html/docbook.xsl"
  63. />
  64. <!-- default xml-html nochunking file (0-length dummy created when chunking) -->
  65. <property name="xml-target-file"
  66. location="${docs.temp.dir}/xml-target-file.dummy"
  67. />
  68. <!-- default value for xml-html copying (copy all graphics) -->
  69. <property name="xml-html-copy" value="*.gif,*.png" />
  70. <property name="binary.pattern"
  71. value="**/*.gif,**/*.png,**/*.doc,**/*.pdf,**/*.jpg,**/*.JPG"
  72. />
  73. <uptodate property="local.dist.uptodate"
  74. targetfile="${docs.dist.dir}/doc/faq.html"
  75. >
  76. <!-- use faq as tag file -->
  77. <srcfiles dir="${docs.src.dir}"
  78. includes="${docs.src.pattern}"
  79. />
  80. </uptodate>
  81. <uptodate property="dist.uptodate"
  82. targetfile="${docs.product.zip}"
  83. >
  84. <!-- use zip as tag file -->
  85. <srcfiles dir="${docs.src.dir}"
  86. includes="${docs.src.pattern}"
  87. />
  88. <srcfiles dir="${docs.dist.dir}"
  89. includes="${docs.src.pattern}"
  90. />
  91. </uptodate>
  92. </target>
  93. <target name="clean-doc-directories"
  94. depends="init"
  95. description="clean build dirs (including local deploy dir)"
  96. >
  97. <delete quiet="on">
  98. <fileset dir="${docs.dist.dir}" />
  99. <fileset dir="${docs.jar.dir}" />
  100. <fileset dir="${docs.temp.dir}" />
  101. </delete>
  102. </target>
  103. <target name="dist"
  104. depends="init,local-dist"
  105. description="create unused doc zip - see ../build/build.xml for installer"
  106. unless="dist.uptodate"
  107. >
  108. <delete file="${docs.product.zip}" />
  109. <zip zipfile="${docs.product.zip}"
  110. basedir="${docs.dist.dir}"
  111. />
  112. <echo message="find doc zip in ${docs.product.zip}" />
  113. </target>
  114. <target name="web.deploy.faqonly"
  115. depends="init,faq"
  116. description="deploy docs.dist.dir faq to web.doc.dir"
  117. >
  118. <copy todir="${web.doc.dir}" filtering="on">
  119. <fileset dir="${docs.dist.dir}/doc" includes="faq.html" />
  120. </copy>
  121. <stripnonbodyhtml srcdir="${web.doc.dir}"
  122. includes="faq.html"
  123. />
  124. <echo message="do link check on index and faq before release"
  125. />
  126. </target>
  127. <target name="web.deploy.faqindex"
  128. depends="init,dist"
  129. description="deploy built faq and index to web.doc.dir"
  130. >
  131. <copy todir="${web.doc.dir}" filtering="on">
  132. <fileset dir="${docs.dist.dir}/doc"
  133. includes="faq.html,index.html"
  134. />
  135. </copy>
  136. <stripnonbodyhtml srcdir="${web.doc.dir}"
  137. includes="faq.html,index.html"
  138. />
  139. <echo message="do link check on index and faq before release"
  140. />
  141. </target>
  142. <target name="web.deploy" depends="web.deploy.README-11" />
  143. <target name="web.deploy.README-11"
  144. depends="init"
  145. description="deploy README-11.html to the web site"
  146. >
  147. <property name="readme11.dir"
  148. location="${web.doc.dir}/documentation/readme11"
  149. />
  150. <mkdir dir="${readme11.dir}" />
  151. <delete file="${readme11.dir}/index.html" />
  152. <mkdir dir="${readme11.dir}" />
  153. <copy tofile="${readme11.dir}/index.html"
  154. file="${aspectj.products.dir}/tools/dist/README-11.html"
  155. filtering="on"
  156. />
  157. <stripnonbodyhtml srcdir="${readme11.dir}"
  158. includes="index.html"
  159. />
  160. </target>
  161. <target name="web.deploy.old"
  162. depends="init"
  163. description="deploy built docs to the web site"
  164. >
  165. <mkdir dir="${web.doc.dir}" />
  166. <delete dir="${web.doc.dir}" />
  167. <mkdir dir="${web.doc.dir}" />
  168. <copy todir="${web.doc.dir}">
  169. <fileset dir="${docs.dist.dir}/doc" />
  170. </copy>
  171. <stripnonbodyhtml srcdir="${web.doc.dir}"
  172. includes="**/*.html"
  173. />
  174. </target>
  175. <!-- ============================================================ -->
  176. <!-- build all doc products -->
  177. <!-- ============================================================ -->
  178. <target name="local-dist"
  179. depends="init"
  180. unless="local.dist.uptodate"
  181. description="avoid local-dist antecedants if uptodate"
  182. >
  183. <antcall target="do-local-dist" />
  184. </target>
  185. <target name="do-local-dist"
  186. depends="init,init-filters,api,faq,devguide,progguide, adk15guide"
  187. description="finish products by copying dist files and library sources"
  188. >
  189. <copy todir="${docs.dist.dir}" filtering="on">
  190. <fileset dir="${docs.src.dir}/dist"
  191. excludes="${binary.pattern}"
  192. />
  193. </copy>
  194. <copy todir="${docs.dist.dir}" filtering="off">
  195. <fileset dir="${docs.src.dir}/dist"
  196. includes="${binary.pattern}"
  197. />
  198. </copy>
  199. <available file="${docs.src.dir}/../org.aspectj.lib/build-aspectjlib.xml"
  200. property="org.aspectj.lib.available"
  201. />
  202. <fail unless="org.aspectj.lib.available"
  203. message="unable to find org.aspectj.lib"
  204. />
  205. <mkdir dir="${docs.dist.dir}/aspectjlib" />
  206. <copy todir="${docs.dist.dir}/doc/aspectjlib" filtering="off">
  207. <fileset dir="${docs.src.dir}/../org.aspectj.lib"
  208. includes="build-aspectjlib.xml,src"
  209. />
  210. </copy>
  211. </target>
  212. <target name="api"
  213. depends="init"
  214. description="javadoc for AspectJ lang, lang.reflect and org.aspectj.weaver.tools"
  215. >
  216. <delete dir="${docs.dist.dir}/doc/api" />
  217. <mkdir dir="${docs.dist.dir}/doc/api" />
  218. <javadoc sourcepath="${aspectj.modules.dir}/runtime/src;${aspectj.modules.dir}/weaver/src"
  219. destdir="${docs.dist.dir}/doc/api"
  220. windowtitle="AspectJ(tm) runtime API"
  221. link="http://java.sun.com/j2se/1.4.2/docs/api"
  222. classpath="${aspectj.modules.dir}/asm/bin;${aspectj.modules.dir}/bridge/bin;${aspectj.modules.dir}/util/bin;${aspectj.modules.dir}/lib/bcel/bcel.jar"
  223. packagenames="org.aspectj.lang,org.aspectj.lang.reflect,org.aspectj.weaver.tools"
  224. />
  225. <!-- note: link ineffective at avoiding see tag warning -->
  226. </target>
  227. <target name="faq" depends="init">
  228. <antcall target="xml-html">
  229. <param name="xml-source-dir"
  230. value="${docs.src.dir}/faq"
  231. />
  232. <param name="xml-source-root" value="faq.xml" />
  233. <param name="xsl-source-file"
  234. value="${nochunk.xsl.source}"
  235. />
  236. <param name="xml-target-dir" value="${docs.dist.dir}" />
  237. <param name="xml-target-file"
  238. value="${docs.dist.dir}/doc/faq.html"
  239. />
  240. </antcall>
  241. </target>
  242. <target name="progguide" depends="init">
  243. <antcall target="build-guide">
  244. <param name="guide.dir" value="progGuideDB" />
  245. <param name="guide.name" value="progguide" />
  246. <param name="xml-html-copy"
  247. value="dd_arrow.gif,aspects.gif,figureUML.gif,overview.gif,telecom.gif,aspectj-docs.css"/>
  248. </antcall>
  249. </target>
  250. <target name="adk15guide" depends="init">
  251. <antcall target="build-guide">
  252. <param name="guide.dir" value="adk15ProgGuideDB" />
  253. <param name="guide.name" value="adk15notebook" />
  254. <param name="xml-html-copy"
  255. value="dd_arrow.gif,aspectj-docs.css"/>
  256. </antcall>
  257. </target>
  258. <target name="devguide" depends="init">
  259. <echo level="info"
  260. message="**** docs: just inside devguide target"
  261. />
  262. <copy todir="${docs.src.dir}/devGuideDB" filtering="off">
  263. <fileset dir="${devguide.icons.dir}"
  264. includes="${include.devguide.icons}"
  265. />
  266. </copy>
  267. <echo level="info"
  268. message="**** docs: about to make call to build-guide target"
  269. />
  270. <antcall target="build-guide">
  271. <param name="xml-html-copy"
  272. value="dd_arrow.gif,aspectj-docs.css,ajbrowser-building.gif,ajbrowser-options.gif,${include.devguide.icons}"
  273. />
  274. <param name="guide.dir" value="devGuideDB" />
  275. <param name="guide.name" value="devguide" />
  276. </antcall>
  277. <delete quiet="on">
  278. <fileset dir="${docs.src.dir}/devGuideDB"
  279. includes="${include.devguide.icons}"
  280. />
  281. </delete>
  282. </target>
  283. <target name="build-guide"
  284. depends="init"
  285. description="build prog or dev guide, using guide.dir and guide.name"
  286. >
  287. <!-- chunked -->
  288. <antcall target="xml-html">
  289. <param name="xml-source-dir"
  290. value="${docs.src.dir}/${guide.dir}"
  291. />
  292. <param name="xml-source-root" value="${guide.name}.xml" />
  293. <param name="xsl-source-file"
  294. value="${chunk.xsl.source}"
  295. />
  296. <param name="xml-target-dir"
  297. value="${docs.dist.dir}/doc/${guide.name}"
  298. />
  299. </antcall>
  300. <!-- single -->
  301. <antcall target="xml-html">
  302. <param name="xml-source-dir"
  303. value="${docs.src.dir}/${guide.dir}"
  304. />
  305. <param name="xml-source-root" value="${guide.name}.xml" />
  306. <param name="xsl-source-file"
  307. value="${nochunk.xsl.source}"
  308. />
  309. <param name="xml-target-dir"
  310. value="${docs.dist.dir}/doc/${guide.name}"
  311. />
  312. <param name="xml-target-file"
  313. value="${docs.dist.dir}/doc/${guide.name}/printable.html"
  314. />
  315. </antcall>
  316. <!-- pdf TODO pdf rendering completes, result is awful
  317. <antcall target="xml-pdf">
  318. <param name="xml-source-dir"
  319. value="${docs.src.dir}/${guide.dir}"/>
  320. <param name="xml-source-root" value="${guide.name}.xml"/>
  321. <param name="pdf-target-file"
  322. value="${docs.dist.dir}/doc/${guide.name}.pdf"/>
  323. </antcall>
  324. -->
  325. </target>
  326. <target name="test-pdf"
  327. depends="init"
  328. description="test pdf build of [prog|dev|adk]guide"
  329. >
  330. <!-- NPE in fop task when building programming guide.
  331. see patch at https://bugs.eclipse.org/bugs/show_bug.cgi?id=81654
  332. <antcall target="build-pdf">
  333. <param name="guide.dir" value="progGuideDB" />
  334. <param name="guide.name" value="progguide" />
  335. </antcall>
  336. -->
  337. <antcall target="build-pdf">
  338. <param name="guide.dir" value="adk15ProgGuideDB" />
  339. <param name="guide.name" value="adk15notebook" />
  340. </antcall>
  341. <copy todir="${docs.src.dir}/devGuideDB" filtering="off">
  342. <fileset dir="${devguide.icons.dir}"
  343. includes="${include.devguide.icons}"
  344. />
  345. </copy>
  346. <antcall target="build-pdf">
  347. <param name="xml-html-copy"
  348. value="ajbrowser-building.gif,ajbrowser-options.gif,${include.devguide.icons}"
  349. />
  350. <param name="guide.dir" value="devGuideDB" />
  351. <param name="guide.name" value="devguide" />
  352. </antcall>
  353. </target>
  354. <target name="build-pdf"
  355. depends="init"
  356. description="build prog or dev guide, using guide.dir and guide.name"
  357. >
  358. <antcall target="xml-pdf">
  359. <param name="xml-source-dir"
  360. value="${docs.src.dir}/${guide.dir}"
  361. />
  362. <param name="xml-source-root" value="${guide.name}.xml" />
  363. <param name="pdf-target-file"
  364. value="${docs.dist.dir}/doc/${guide.name}.pdf"
  365. />
  366. </antcall>
  367. </target>
  368. <!-- XML conversion stuff -->
  369. <!-- xml-pdf -->
  370. <target name="xml-pdf">
  371. <delete file="${pdf-target-file}" />
  372. <touch file="${pdf-target-file}" />
  373. <delete file="${xml-source-dir}/index.fo" />
  374. <!-- produce index.fo from docbook sources -->
  375. <java classname="com.icl.saxon.StyleSheet" fork="yes">
  376. <classpath>
  377. <pathelement location="${aspectj.modules.lib.dir}/saxon/saxon.jar"
  378. />
  379. </classpath>
  380. <arg value="-o" />
  381. <arg value="${xml-source-dir}/index.fo" />
  382. <arg value="${xml-source-dir}/${xml-source-root}" />
  383. <arg value="${aspectj.modules.lib.dir}/docbook/docbook-xsl/fo/docbook.xsl"
  384. />
  385. </java>
  386. <!-- index.fo to pdf (TODO if formatting fixed, to init-taskdefs) -->
  387. <taskdef name="fop"
  388. classname="org.apache.fop.tools.anttasks.Fop"
  389. >
  390. <classpath>
  391. <fileset dir="${aspectj.modules.lib.dir}/docbook/fop">
  392. <include name="fop.jar" />
  393. <include name="batik.jar" />
  394. <include name="avalon.jar" />
  395. </fileset>
  396. <fileset dir="${aspectj.modules.lib.dir}/ant">
  397. <include name="xalan.jar" />
  398. <include name="xercesImpl.jar" />
  399. <include name="xml-apis.jar" />
  400. </fileset>
  401. </classpath>
  402. </taskdef>
  403. <!-- TODO messagelevel="info" -->
  404. <fop format="application/pdf"
  405. messagelevel="verbose"
  406. basedir="${guide.dir}"
  407. fofile="${guide.dir}/index.fo"
  408. outfile="${pdf-target-file}"
  409. >
  410. </fop>
  411. <delete quiet="on" file="${guide.dir}/index.fo" />
  412. </target>
  413. <target name="xml-html"
  414. description="antcall(xml-source-dir, xml-source-root, xml-target-dir, xml-target-file)
  415. convert xml to html using docbook. parameters:
  416. xml-source-dir # base directory of source
  417. xml-source-root # base file of source (relative to xml-source-dir)
  418. xsl-source-file # xsl transform to apply (use chunk.xsl.source by default)
  419. xml-target-dir # target directory for output (used as xsl param base.dir)
  420. xml-target-file # full path to output file in xml-source-dir, ignored when chunking
  421. xml-html-copy # copy files to target (defaults to *.gif,*.png"
  422. >
  423. <mkdir dir="${xml-target-dir}" />
  424. <copy todir="${xml-target-dir}">
  425. <fileset dir="${xml-source-dir}"
  426. includes="${xml-html-copy}"
  427. />
  428. </copy>
  429. <java classname="com.icl.saxon.StyleSheet"
  430. classpath="${aspectj.modules.lib.dir}/saxon/saxon.jar"
  431. fork="yes"
  432. failonerror="yes"
  433. >
  434. <!-- todo: establish failure policy -->
  435. <arg value="-o" />
  436. <arg value="${xml-target-file}" />
  437. <arg value="${xml-source-dir}/${xml-source-root}" />
  438. <arg value="${xsl-source-file}" />
  439. <arg value="base.dir=${xml-target-dir}/" />
  440. <arg value="use.id.as.filename=1" />
  441. </java>
  442. </target>
  443. </project>