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

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