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 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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. <!-- All rights reserved. -->
  5. <!-- This program and the accompanying materials are made available -->
  6. <!-- under the terms of the Common Public License v1.0 -->
  7. <!-- which accompanies this distribution and is available at -->
  8. <!-- http://www.eclipse.org/legal/cpl-v10.html -->
  9. <!-- -->
  10. <!-- Contributors: -->
  11. <!-- Xerox/PARC initial implementation -->
  12. <!-- ========================================================================= -->
  13. <!DOCTYPE project [
  14. <!ENTITY build-properties SYSTEM "file:../build/build-properties.xml">
  15. ]>
  16. <project name="build-docs" default="dist" basedir=".">
  17. <property name="project.name" value="build-docs"/>
  18. <target name="product" depends="local-dist"/>
  19. <target name="clean"
  20. depends="clean-directories,clean-doc-directories"/>
  21. <!-- ===================================================================== -->
  22. <!-- Init -->
  23. <!-- ===================================================================== -->
  24. &build-properties;
  25. <target name="init" depends="init-properties,init-directories">
  26. <property name="docs.src.pattern"
  27. value="**/*.xml,**/*.html,**/*.doc,**/*.gif,**/*.java,**/*.lst,**/*.pdf"/>
  28. <property name="docs.src.dir"
  29. location="${aspectj.modules.docs.dir}"/>
  30. <property name="docs.dist.dir" location="${aj.dist.dir}/docs"/>
  31. <property name="docs.temp.dir" location="${aj.temp.dir}/doc"/>
  32. <property name="web.doc.dir" location="${aj.webDeploy.dir}/documentation/dist"/>
  33. <property name="docs.product.name"
  34. value="aspectj-docs-${build.version}"/>
  35. <property name="docs.product.zip"
  36. location="${aj.dist.dir}/${docs.product.name}.zip"/>
  37. <!-- must specify (not *.gif) to not delete other gifs during build-in-place -->
  38. <!-- to find refs: gp ax imagedata | sed -n 's|.*\=\"\(..*\)\".*|\1|p' -->
  39. <property name="devguide.icons.dir"
  40. location="${aspectj.modules.dir}/ajde/src/org/aspectj/ajde/resources/actions"/>
  41. <property name="include.devguide.icons"
  42. value="build.gif,openConfig.gif,browseroptions.gif" />
  43. <!-- callers of xml-html use these by default -->
  44. <property name="chunk.xsl.source"
  45. location="${aspectj.modules.lib.dir}/docbook/docbook-xsl/html/chunk.xsl"/>
  46. <property name="nochunk.xsl.source"
  47. location="${aspectj.modules.lib.dir}/docbook/docbook-xsl/html/docbook.xsl"/>
  48. <!-- default xml-html nochunking file (0-length dummy created when chunking) -->
  49. <property name="xml-target-file"
  50. location="${docs.temp.dir}/xml-target-file.dummy"/>
  51. <!-- default value for xml-html copying (copy all graphics) -->
  52. <property name="xml-html-copy" value="*.gif,*.png" />
  53. <property name="binary.pattern"
  54. value="**/*.gif,**/*.png,**/*.doc,**/*.pdf,**/*.jpg,**/*.JPG"/>
  55. <uptodate property="local.dist.uptodate"
  56. targetfile="${docs.dist.dir}/doc/faq.html"> <!-- use faq as tag file -->
  57. <srcfiles dir="${docs.src.dir}" includes="${docs.src.pattern}"/>
  58. </uptodate>
  59. <uptodate property="dist.uptodate"
  60. targetfile="${docs.product.zip}"> <!-- use zip as tag file -->
  61. <srcfiles dir="${docs.src.dir}" includes="${docs.src.pattern}"/>
  62. <srcfiles dir="${docs.dist.dir}" includes="${docs.src.pattern}"/>
  63. </uptodate>
  64. </target>
  65. <target name="clean-doc-directories" depends="init"
  66. description="clean build dirs (including local deploy dir)">
  67. <delete quiet="on">
  68. <fileset dir="${docs.dist.dir}" />
  69. <fileset dir="${docs.jar.dir}" />
  70. <fileset dir="${docs.temp.dir}" />
  71. </delete>
  72. </target>
  73. <target name="dist" depends="init,local-dist"
  74. description="create unused doc zip - see ../build/build.xml for installer"
  75. unless="dist.uptodate">
  76. <delete file="${docs.product.zip}"/>
  77. <zip zipfile="${docs.product.zip}"
  78. basedir="${docs.dist.dir}"/>
  79. <echo message="find doc zip in ${docs.product.zip}"/>
  80. </target>
  81. <target name="web.deploy.faqonly" depends="init,faq"
  82. description="deploy docs.dist.dir faq to web.doc.dir">
  83. <copy todir="${web.doc.dir}" filtering="on">
  84. <fileset dir="${docs.dist.dir}/doc" includes="faq.html"/>
  85. </copy>
  86. <stripnonbodyhtml srcdir="${web.doc.dir}"
  87. includes="faq.html" />
  88. <echo message="do link check on index and faq before release"/>
  89. </target>
  90. <target name="web.deploy.faqindex" depends="init,dist"
  91. description="deploy built faq and index to web.doc.dir">
  92. <copy todir="${web.doc.dir}" filtering="on">
  93. <fileset dir="${docs.dist.dir}/doc"
  94. includes="faq.html,index.html"/>
  95. </copy>
  96. <stripnonbodyhtml srcdir="${web.doc.dir}"
  97. includes="faq.html,index.html" />
  98. <echo message="do link check on index and faq before release"/>
  99. </target>
  100. <target name="web.deploy" depends="web.deploy.README-11" />
  101. <target name="web.deploy.README-11" depends="init"
  102. description="deploy README-11.html to the web site">
  103. <property name="readme11.dir"
  104. location="${web.doc.dir}/documentation/readme11"/>
  105. <mkdir dir="${readme11.dir}"/>
  106. <delete file="${readme11.dir}/index.html"/>
  107. <mkdir dir="${readme11.dir}"/>
  108. <copy tofile="${readme11.dir}/index.html"
  109. file="${aspectj.products.dir}/tools/dist/README-11.html"
  110. filtering="on"/>
  111. <stripnonbodyhtml srcdir="${readme11.dir}"
  112. includes="index.html" />
  113. </target>
  114. <target name="web.deploy.old" depends="init"
  115. description="deploy built docs to the web site">
  116. <mkdir dir="${web.doc.dir}"/>
  117. <delete dir="${web.doc.dir}"/>
  118. <mkdir dir="${web.doc.dir}"/>
  119. <copy todir="${web.doc.dir}">
  120. <fileset dir="${docs.dist.dir}/doc"/>
  121. </copy>
  122. <stripnonbodyhtml srcdir="${web.doc.dir}"
  123. includes="**/*.html" />
  124. </target>
  125. <!-- ============================================================ -->
  126. <!-- build all doc products -->
  127. <!-- ============================================================ -->
  128. <target name="local-dist" depends="init"
  129. unless="local.dist.uptodate"
  130. description="avoid local-dist antecedants if uptodate">
  131. <antcall target="do-local-dist"/>
  132. </target>
  133. <target name="do-local-dist"
  134. depends="init,init-filters,api,faq,devguide,progguide, adk15guide"
  135. description="finish products by copying dist files">
  136. <copy todir="${docs.dist.dir}" filtering="on">
  137. <fileset dir="${docs.src.dir}/dist"
  138. excludes="${binary.pattern}"/>
  139. </copy>
  140. <copy todir="${docs.dist.dir}" filtering="off">
  141. <fileset dir="${docs.src.dir}/dist"
  142. includes="${binary.pattern}"/>
  143. </copy>
  144. </target>
  145. <target name="api" depends="init"
  146. description="javadoc for AspectJ lang, lang.reflect and org.aspectj.weaver.tools">
  147. <delete dir="${docs.dist.dir}/doc/api"/>
  148. <mkdir dir="${docs.dist.dir}/doc/api"/>
  149. <javadoc sourcepath="${aspectj.modules.dir}/runtime/src;${aspectj.modules.dir}/weaver/src"
  150. destdir="${docs.dist.dir}/doc/api"
  151. windowtitle="AspectJ(tm) runtime API"
  152. link="http://java.sun.com/j2se/1.4.2/docs/api"
  153. classpath="${aspectj.modules.dir}/asm/bin;${aspectj.modules.dir}/bridge/bin;${aspectj.modules.dir}/util/bin;${aspectj.modules.dir}/lib/bcel/bcel.jar"
  154. packagenames="org.aspectj.lang,org.aspectj.lang.reflect,org.aspectj.weaver.tools" />
  155. <!-- note: link ineffective at avoiding see tag warning -->
  156. </target>
  157. <target name="faq" depends="init">
  158. <antcall target="xml-html">
  159. <param name="xml-source-dir"
  160. value="${docs.src.dir}/faq"/>
  161. <param name="xml-source-root"
  162. value="faq.xml"/>
  163. <param name="xsl-source-file"
  164. value="${nochunk.xsl.source}"/>
  165. <param name="xml-target-dir"
  166. value="${docs.dist.dir}"/>
  167. <param name="xml-target-file"
  168. value="${docs.dist.dir}/doc/faq.html"/>
  169. </antcall>
  170. </target>
  171. <!-- experimental targets collapse guide-making (lose individual targets) -->
  172. <target name="progguide" depends="init">
  173. <antcall target="build-guide">
  174. <param name="guide.dir" value="progGuideDB"/>
  175. <param name="guide.name" value="progguide"/>
  176. </antcall>
  177. </target>
  178. <target name="adk15guide" depends="init">
  179. <antcall target="build-guide">
  180. <param name="guide.dir" value="adk15ProgGuideDB"/>
  181. <param name="guide.name" value="adk15notebook"/>
  182. </antcall>
  183. </target>
  184. <target name="devguide" depends="init">
  185. <!-- GCH -->
  186. <echo message="**** docs: just inside devguide target"/>
  187. <copy todir="${docs.src.dir}/devGuideDB" filtering="off" >
  188. <fileset dir="${devguide.icons.dir}"
  189. includes="${include.devguide.icons}" />
  190. </copy>
  191. <!-- GCH -->
  192. <echo message="**** docs: about to make call to build-guide target"/>
  193. <antcall target="build-guide">
  194. <param name="xml-html-copy" value="ajbrowser-building.gif,ajbrowser-options.gif,${include.devguide.icons}" />
  195. <param name="guide.dir" value="devGuideDB"/>
  196. <param name="guide.name" value="devguide"/>
  197. </antcall>
  198. <delete quiet="on"> <!-- clean icons for build-in-place -->
  199. <fileset dir="${docs.src.dir}/devGuideDB"
  200. includes="${include.devguide.icons}" />
  201. </delete>
  202. </target>
  203. <target name="build-guide" depends="init"
  204. description="build prog or dev guide, using guide.dir and guide.name">
  205. <!-- chunked -->
  206. <antcall target="xml-html">
  207. <param name="xml-source-dir"
  208. value="${docs.src.dir}/${guide.dir}"/>
  209. <param name="xml-source-root"
  210. value="${guide.name}.xml"/>
  211. <param name="xsl-source-file"
  212. value="${chunk.xsl.source}"/>
  213. <param name="xml-target-dir"
  214. value="${docs.dist.dir}/doc/${guide.name}"/>
  215. </antcall>
  216. <!-- single -->
  217. <antcall target="xml-html">
  218. <param name="xml-source-dir"
  219. value="${docs.src.dir}/${guide.dir}"/>
  220. <param name="xml-source-root"
  221. value="${guide.name}.xml"/>
  222. <param name="xsl-source-file"
  223. value="${nochunk.xsl.source}"/>
  224. <param name="xml-target-dir"
  225. value="${docs.dist.dir}/doc/${guide.name}"/>
  226. <param name="xml-target-file"
  227. value="${docs.dist.dir}/doc/${guide.name}/printable.html"/>
  228. </antcall>
  229. <!-- pdf - enable when it works
  230. <antcall target="xml-pdf">
  231. <param name="xml-source-dir"
  232. value="${docs.src.dir}/doc/${guide.dir}"/>
  233. <param name="xml-source-root" value="${guide.name}.xml"/>
  234. <param name="xml-target-file"
  235. value="${docs.dist.dir}/doc/${guide.name}.pdf"/>
  236. </antcall>
  237. -->
  238. </target>
  239. <!-- end of experimental targets -->
  240. <!-- XML conversion stuff -->
  241. <!-- todo xml-pdf broken; when fixed, see xml-html for example -->
  242. <target name="xml-pdf">
  243. <delete file="${xml-target-file}"/>
  244. <touch file="${xml-target-file}"/>
  245. <java classname="com.icl.saxon.StyleSheet"
  246. fork="yes">
  247. <classpath>
  248. <pathelement location="${saxon.dir}/saxon.jar"/>
  249. </classpath>
  250. <arg value="-o"/>
  251. <arg value="${xml-source-dir}/index.fo"/>
  252. <arg value="${xml-source-dir}/${xml-source-root}"/>
  253. <arg value="${docbook.dir}/docbook-xsl/fo/docbook.xsl"/>
  254. </java>
  255. </target>
  256. <target name="xml-html"
  257. description="antcall(xml-source-dir, xml-source-root, xml-target-dir, xml-target-file)
  258. convert xml to html using docbook. parameters:
  259. xml-source-dir # base directory of source
  260. xml-source-root # base file of source (relative to xml-source-dir)
  261. xsl-source-file # xsl transform to apply (use chunk.xsl.source by default)
  262. xml-target-dir # target directory for output (used as xsl param base.dir)
  263. xml-target-file # full path to output file in xml-source-dir, ignored when chunking
  264. xml-html-copy # copy files to target (defaults to *.gif,*.png">
  265. <mkdir dir="${xml-target-dir}"/>
  266. <copy todir="${xml-target-dir}">
  267. <fileset dir="${xml-source-dir}"
  268. includes="${xml-html-copy}"/>
  269. </copy>
  270. <java classname="com.icl.saxon.StyleSheet"
  271. classpath="${aspectj.modules.lib.dir}/saxon/saxon.jar"
  272. fork="yes"
  273. failonerror="yes"> <!-- todo: establish failure policy -->
  274. <arg value="-o"/>
  275. <arg value="${xml-target-file}"/>
  276. <arg value="${xml-source-dir}/${xml-source-root}"/>
  277. <arg value="${xsl-source-file}"/>
  278. <arg value="base.dir=${xml-target-dir}/"/>
  279. <arg value="use.id.as.filename=1"/>
  280. </java>
  281. </target>
  282. <target name="info"
  283. description="misc info for writing and building docbook">
  284. <echo>
  285. ---- misc info for writing and building docbook
  286. - link tag linkend attribute takes an id
  287. - xsl converts as needed during output
  288. - do NOT use ulink; this will be converted to ""
  289. (but see param citerefentry-link: might enable this)
  290. - to use sensible names for the files produced,
  291. - use an xsl wrapper to add/modify features
  292. - set flag to use the id of the top-level element in the output
  293. file as the filename.
  294. xsl:param name="use.id.as.filename" select="1"
  295. - fyi, other related parameters: html-ext, root-filename
  296. - In this example, the top-level element in the output file
  297. is the refentry, so set ids which become the basename of the file:
  298. refentry id="aspectj-mode" # in aspectj-mode.xml, produces aspecj-mode.html
  299. refentry id="ajdee" # in ajdee.xml, produces ajdee.html
  300. -- fyi
  301. - related parameters:
  302. html-ext, root-filename
  303. - these tags did not work for me:
  304. dbhtml filename="foo.htm"
  305. dbhtml prefix="foo-"
  306. - resources
  307. - the dtd reference for docbook
  308. http://www.oreilly.com/catalog/docbook/chapter/book/docbook.html
  309. - the stylesheet reference for docbook xsl
  310. http://docbook.sourceforge.net/projects/dsssl/doc/html.html
  311. - todo
  312. - fyi, generate.reference.titlepage appears not to be respected.
  313. tried to add if statement to html/refentry.xsl, but file still gen'd
  314. </echo>
  315. </target>
  316. </project>