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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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"/>
  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"
  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="devguide" depends="init">
  179. <copy todir="${docs.src.dir}/devGuideDB" filtering="off" >
  180. <fileset dir="${devguide.icons.dir}"
  181. includes="${include.devguide.icons}" />
  182. </copy>
  183. <antcall target="build-guide">
  184. <param name="xml-html-copy" value="ajbrowser-building.gif,ajbrowser-options.gif,${include.devguide.icons}" />
  185. <param name="guide.dir" value="devGuideDB"/>
  186. <param name="guide.name" value="devguide"/>
  187. </antcall>
  188. <delete quiet="on"> <!-- clean icons for build-in-place -->
  189. <fileset dir="${docs.src.dir}/devGuideDB"
  190. includes="${include.devguide.icons}" />
  191. </delete>
  192. </target>
  193. <target name="build-guide" depends="init"
  194. description="build prog or dev guide, using guide.dir and guide.name">
  195. <!-- chunked -->
  196. <antcall target="xml-html">
  197. <param name="xml-source-dir"
  198. value="${docs.src.dir}/${guide.dir}"/>
  199. <param name="xml-source-root"
  200. value="${guide.name}.xml"/>
  201. <param name="xsl-source-file"
  202. value="${chunk.xsl.source}"/>
  203. <param name="xml-target-dir"
  204. value="${docs.dist.dir}/doc/${guide.name}"/>
  205. </antcall>
  206. <!-- single -->
  207. <antcall target="xml-html">
  208. <param name="xml-source-dir"
  209. value="${docs.src.dir}/${guide.dir}"/>
  210. <param name="xml-source-root"
  211. value="${guide.name}.xml"/>
  212. <param name="xsl-source-file"
  213. value="${nochunk.xsl.source}"/>
  214. <param name="xml-target-dir"
  215. value="${docs.dist.dir}/doc/${guide.name}"/>
  216. <param name="xml-target-file"
  217. value="${docs.dist.dir}/doc/${guide.name}/printable.html"/>
  218. </antcall>
  219. <!-- pdf - enable when it works
  220. <antcall target="xml-pdf">
  221. <param name="xml-source-dir"
  222. value="${docs.src.dir}/doc/${guide.dir}"/>
  223. <param name="xml-source-root" value="${guide.name}.xml"/>
  224. <param name="xml-target-file"
  225. value="${docs.dist.dir}/doc/${guide.name}.pdf"/>
  226. </antcall>
  227. -->
  228. </target>
  229. <!-- end of experimental targets -->
  230. <!-- XML conversion stuff -->
  231. <!-- todo xml-pdf broken; when fixed, see xml-html for example -->
  232. <target name="xml-pdf">
  233. <delete file="${xml-target-file}"/>
  234. <touch file="${xml-target-file}"/>
  235. <java classname="com.icl.saxon.StyleSheet"
  236. fork="yes">
  237. <classpath>
  238. <pathelement location="${saxon.dir}/saxon.jar"/>
  239. </classpath>
  240. <arg value="-o"/>
  241. <arg value="${xml-source-dir}/index.fo"/>
  242. <arg value="${xml-source-dir}/${xml-source-root}"/>
  243. <arg value="${docbook.dir}/docbook-xsl/fo/docbook.xsl"/>
  244. </java>
  245. </target>
  246. <target name="xml-html"
  247. description="antcall(xml-source-dir, xml-source-root, xml-target-dir, xml-target-file)
  248. convert xml to html using docbook. parameters:
  249. xml-source-dir # base directory of source
  250. xml-source-root # base file of source (relative to xml-source-dir)
  251. xsl-source-file # xsl transform to apply (use chunk.xsl.source by default)
  252. xml-target-dir # target directory for output (used as xsl param base.dir)
  253. xml-target-file # full path to output file in xml-source-dir, ignored when chunking
  254. xml-html-copy # copy files to target (defaults to *.gif,*.png">
  255. <mkdir dir="${xml-target-dir}"/>
  256. <copy todir="${xml-target-dir}">
  257. <fileset dir="${xml-source-dir}"
  258. includes="${xml-html-copy}"/>
  259. </copy>
  260. <java classname="com.icl.saxon.StyleSheet"
  261. classpath="${aspectj.modules.lib.dir}/saxon/saxon.jar"
  262. fork="yes"
  263. failonerror="yes"> <!-- todo: establish failure policy -->
  264. <arg value="-o"/>
  265. <arg value="${xml-target-file}"/>
  266. <arg value="${xml-source-dir}/${xml-source-root}"/>
  267. <arg value="${xsl-source-file}"/>
  268. <arg value="base.dir=${xml-target-dir}/"/>
  269. <arg value="use.id.as.filename=1"/>
  270. </java>
  271. </target>
  272. <target name="info"
  273. description="misc info for writing and building docbook">
  274. <echo>
  275. ---- misc info for writing and building docbook
  276. - link tag linkend attribute takes an id
  277. - xsl converts as needed during output
  278. - do NOT use ulink; this will be converted to ""
  279. (but see param citerefentry-link: might enable this)
  280. - to use sensible names for the files produced,
  281. - use an xsl wrapper to add/modify features
  282. - set flag to use the id of the top-level element in the output
  283. file as the filename.
  284. xsl:param name="use.id.as.filename" select="1"
  285. - fyi, other related parameters: html-ext, root-filename
  286. - In this example, the top-level element in the output file
  287. is the refentry, so set ids which become the basename of the file:
  288. refentry id="aspectj-mode" # in aspectj-mode.xml, produces aspecj-mode.html
  289. refentry id="ajdee" # in ajdee.xml, produces ajdee.html
  290. -- fyi
  291. - related parameters:
  292. html-ext, root-filename
  293. - these tags did not work for me:
  294. dbhtml filename="foo.htm"
  295. dbhtml prefix="foo-"
  296. - resources
  297. - the dtd reference for docbook
  298. http://www.oreilly.com/catalog/docbook/chapter/book/docbook.html
  299. - the stylesheet reference for docbook xsl
  300. http://docbook.sourceforge.net/projects/dsssl/doc/html.html
  301. - todo
  302. - fyi, generate.reference.titlepage appears not to be respected.
  303. tried to add if statement to html/refentry.xsl, but file still gen'd
  304. </echo>
  305. </target>
  306. </project>