123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- <!-- -*- Mode: SGML; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -->
- <!-- ========================================================================= -->
- <!-- Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), -->
- <!-- 2004-2005 Contributors. -->
- <!-- All rights reserved. -->
- <!-- This program and the accompanying materials are made available -->
- <!-- under the terms of the Common Public License v1.0 -->
- <!-- which accompanies this distribution and is available at -->
- <!-- http://www.eclipse.org/legal/cpl-v10.html -->
- <!-- -->
- <!-- Contributors: -->
- <!-- Xerox/PARC initial implementation -->
- <!-- ========================================================================= -->
-
- <!DOCTYPE project [
- <!ENTITY build-properties SYSTEM "file:../build/build-properties.xml">
- ]>
- <project name="build-docs" default="dist" basedir=".">
-
- <property name="project.name" value="build-docs" />
-
- <target name="product" depends="local-dist" />
- <target name="clean"
- depends="clean-directories,clean-doc-directories"
- />
-
- <!-- ===================================================================== -->
- <!-- Init -->
- <!-- ===================================================================== -->
-
- &build-properties;
-
- <target name="init" depends="init-properties,init-directories">
-
- <property name="docs.src.pattern"
- value="**/*.xml,**/*.html,**/*.doc,**/*.gif,**/*.java,**/*.lst,**/*.pdf"
- />
- <property name="docs.src.dir"
- location="${aspectj.modules.docs.dir}"
- />
-
- <property name="docs.dist.dir"
- location="${aj.dist.dir}/docs"
- />
- <property name="docs.temp.dir"
- location="${aj.temp.dir}/doc"
- />
- <property name="web.doc.dir"
- location="${aj.webDeploy.dir}/documentation/dist"
- />
-
- <property name="docs.product.name"
- value="aspectj-docs-${build.version}"
- />
-
- <property name="docs.product.zip"
- location="${aj.dist.dir}/${docs.product.name}.zip"
- />
- <!-- must specify (not *.gif) to not delete other gifs during build-in-place -->
- <!-- to find refs: gp ax imagedata | sed -n 's|.*\=\"\(..*\)\".*|\1|p' -->
- <property name="devguide.icons.dir"
- location="${aspectj.modules.dir}/ajde/src/org/aspectj/ajde/resources/actions"
- />
- <property name="include.devguide.icons"
- value="build.gif,openConfig.gif,browseroptions.gif"
- />
-
- <!-- callers of xml-html use these by default -->
- <property name="chunk.xsl.source"
- location="${aspectj.modules.lib.dir}/docbook/docbook-xsl/html/chunk.xsl"
- />
- <property name="nochunk.xsl.source"
- location="${aspectj.modules.lib.dir}/docbook/docbook-xsl/html/docbook.xsl"
- />
- <!-- default xml-html nochunking file (0-length dummy created when chunking) -->
- <property name="xml-target-file"
- location="${docs.temp.dir}/xml-target-file.dummy"
- />
- <!-- default value for xml-html copying (copy all graphics) -->
- <property name="xml-html-copy" value="*.gif,*.png" />
- <property name="binary.pattern"
- value="**/*.gif,**/*.png,**/*.doc,**/*.pdf,**/*.jpg,**/*.JPG"
- />
- <uptodate property="local.dist.uptodate"
- targetfile="${docs.dist.dir}/doc/faq.html"
- >
- <!-- use faq as tag file -->
- <srcfiles dir="${docs.src.dir}"
- includes="${docs.src.pattern}"
- />
- </uptodate>
- <uptodate property="dist.uptodate"
- targetfile="${docs.product.zip}"
- >
- <!-- use zip as tag file -->
- <srcfiles dir="${docs.src.dir}"
- includes="${docs.src.pattern}"
- />
- <srcfiles dir="${docs.dist.dir}"
- includes="${docs.src.pattern}"
- />
- </uptodate>
-
- </target>
-
- <target name="clean-doc-directories"
- depends="init"
- description="clean build dirs (including local deploy dir)"
- >
- <delete quiet="on">
- <fileset dir="${docs.dist.dir}" />
- <fileset dir="${docs.jar.dir}" />
- <fileset dir="${docs.temp.dir}" />
- </delete>
- </target>
-
- <target name="dist"
- depends="init,local-dist"
- description="create unused doc zip - see ../build/build.xml for installer"
- unless="dist.uptodate"
- >
- <delete file="${docs.product.zip}" />
- <zip zipfile="${docs.product.zip}"
- basedir="${docs.dist.dir}"
- />
-
- <echo message="find doc zip in ${docs.product.zip}" />
- </target>
-
- <target name="web.deploy.faqonly"
- depends="init,faq"
- description="deploy docs.dist.dir faq to web.doc.dir"
- >
- <copy todir="${web.doc.dir}" filtering="on">
- <fileset dir="${docs.dist.dir}/doc" includes="faq.html" />
- </copy>
- <stripnonbodyhtml srcdir="${web.doc.dir}"
- includes="faq.html"
- />
- <echo message="do link check on index and faq before release"
- />
- </target>
-
- <target name="web.deploy.faqindex"
- depends="init,dist"
- description="deploy built faq and index to web.doc.dir"
- >
- <copy todir="${web.doc.dir}" filtering="on">
- <fileset dir="${docs.dist.dir}/doc"
- includes="faq.html,index.html"
- />
- </copy>
- <stripnonbodyhtml srcdir="${web.doc.dir}"
- includes="faq.html,index.html"
- />
- <echo message="do link check on index and faq before release"
- />
- </target>
-
- <target name="web.deploy" depends="web.deploy.README-11" />
-
- <target name="web.deploy.README-11"
- depends="init"
- description="deploy README-11.html to the web site"
- >
- <property name="readme11.dir"
- location="${web.doc.dir}/documentation/readme11"
- />
- <mkdir dir="${readme11.dir}" />
- <delete file="${readme11.dir}/index.html" />
- <mkdir dir="${readme11.dir}" />
- <copy tofile="${readme11.dir}/index.html"
- file="${aspectj.products.dir}/tools/dist/README-11.html"
- filtering="on"
- />
- <stripnonbodyhtml srcdir="${readme11.dir}"
- includes="index.html"
- />
- </target>
-
- <target name="web.deploy.old"
- depends="init"
- description="deploy built docs to the web site"
- >
- <mkdir dir="${web.doc.dir}" />
- <delete dir="${web.doc.dir}" />
- <mkdir dir="${web.doc.dir}" />
- <copy todir="${web.doc.dir}">
- <fileset dir="${docs.dist.dir}/doc" />
- </copy>
- <stripnonbodyhtml srcdir="${web.doc.dir}"
- includes="**/*.html"
- />
- </target>
-
- <!-- ============================================================ -->
- <!-- build all doc products -->
- <!-- ============================================================ -->
- <target name="local-dist"
- depends="init"
- unless="local.dist.uptodate"
- description="avoid local-dist antecedants if uptodate"
- >
- <antcall target="do-local-dist" />
- </target>
-
- <target name="do-local-dist"
- depends="init,init-filters,api,faq,devguide,progguide, adk15guide"
- description="finish products by copying dist files and library sources"
- >
-
- <copy todir="${docs.dist.dir}" filtering="on">
- <fileset dir="${docs.src.dir}/dist"
- excludes="${binary.pattern}"
- />
- </copy>
- <copy todir="${docs.dist.dir}" filtering="off">
- <fileset dir="${docs.src.dir}/dist"
- includes="${binary.pattern}"
- />
- </copy>
- <available file="${docs.src.dir}/../org.aspectj.lib/build-aspectjlib.xml"
- property="org.aspectj.lib.available"
- />
- <fail unless="org.aspectj.lib.available"
- message="unable to find org.aspectj.lib"
- />
- <mkdir dir="${docs.dist.dir}/aspectjlib" />
- <copy todir="${docs.dist.dir}/doc/aspectjlib" filtering="off">
- <fileset dir="${docs.src.dir}/../org.aspectj.lib"
- includes="build-aspectjlib.xml,src"
- />
- </copy>
- </target>
-
- <target name="api"
- depends="init"
- description="javadoc for AspectJ lang, lang.reflect and org.aspectj.weaver.tools"
- >
- <delete dir="${docs.dist.dir}/doc/api" />
- <mkdir dir="${docs.dist.dir}/doc/api" />
- <javadoc sourcepath="${aspectj.modules.dir}/runtime/src;${aspectj.modules.dir}/weaver/src"
- destdir="${docs.dist.dir}/doc/api"
- windowtitle="AspectJ(tm) runtime API"
- link="http://java.sun.com/j2se/1.4.2/docs/api"
- classpath="${aspectj.modules.dir}/asm/bin;${aspectj.modules.dir}/bridge/bin;${aspectj.modules.dir}/util/bin;${aspectj.modules.dir}/lib/bcel/bcel.jar"
- packagenames="org.aspectj.lang,org.aspectj.lang.reflect,org.aspectj.weaver.tools"
- />
- <!-- note: link ineffective at avoiding see tag warning -->
- </target>
-
- <target name="faq" depends="init">
- <antcall target="xml-html">
- <param name="xml-source-dir"
- value="${docs.src.dir}/faq"
- />
- <param name="xml-source-root" value="faq.xml" />
- <param name="xsl-source-file"
- value="${nochunk.xsl.source}"
- />
- <param name="xml-target-dir" value="${docs.dist.dir}" />
- <param name="xml-target-file"
- value="${docs.dist.dir}/doc/faq.html"
- />
- </antcall>
- </target>
-
- <target name="progguide" depends="init">
- <antcall target="build-guide">
- <param name="guide.dir" value="progGuideDB" />
- <param name="guide.name" value="progguide" />
- <param name="xml-html-copy"
- value="dd_arrow.gif,aspects.gif,figureUML.gif,overview.gif,telecom.gif,aspectj-docs.css"/>
- </antcall>
- </target>
-
- <target name="adk15guide" depends="init">
- <antcall target="build-guide">
- <param name="guide.dir" value="adk15ProgGuideDB" />
- <param name="guide.name" value="adk15notebook" />
- <param name="xml-html-copy"
- value="dd_arrow.gif,aspectj-docs.css"/>
- </antcall>
- </target>
-
-
- <target name="devguide" depends="init">
-
- <echo level="info"
- message="**** docs: just inside devguide target"
- />
-
- <copy todir="${docs.src.dir}/devGuideDB" filtering="off">
- <fileset dir="${devguide.icons.dir}"
- includes="${include.devguide.icons}"
- />
- </copy>
-
- <echo level="info"
- message="**** docs: about to make call to build-guide target"
- />
-
- <antcall target="build-guide">
- <param name="xml-html-copy"
- value="dd_arrow.gif,aspectj-docs.css,ajbrowser-building.gif,ajbrowser-options.gif,${include.devguide.icons}"
- />
- <param name="guide.dir" value="devGuideDB" />
- <param name="guide.name" value="devguide" />
- </antcall>
- <delete quiet="on">
- <fileset dir="${docs.src.dir}/devGuideDB"
- includes="${include.devguide.icons}"
- />
- </delete>
- </target>
-
- <target name="build-guide"
- depends="init"
- description="build prog or dev guide, using guide.dir and guide.name"
- >
- <!-- chunked -->
- <antcall target="xml-html">
- <param name="xml-source-dir"
- value="${docs.src.dir}/${guide.dir}"
- />
- <param name="xml-source-root" value="${guide.name}.xml" />
- <param name="xsl-source-file"
- value="${chunk.xsl.source}"
- />
- <param name="xml-target-dir"
- value="${docs.dist.dir}/doc/${guide.name}"
- />
- </antcall>
- <!-- single -->
- <antcall target="xml-html">
- <param name="xml-source-dir"
- value="${docs.src.dir}/${guide.dir}"
- />
- <param name="xml-source-root" value="${guide.name}.xml" />
- <param name="xsl-source-file"
- value="${nochunk.xsl.source}"
- />
- <param name="xml-target-dir"
- value="${docs.dist.dir}/doc/${guide.name}"
- />
- <param name="xml-target-file"
- value="${docs.dist.dir}/doc/${guide.name}/printable.html"
- />
- </antcall>
- <!-- pdf TODO pdf rendering completes, result is awful
- <antcall target="xml-pdf">
- <param name="xml-source-dir"
- value="${docs.src.dir}/${guide.dir}"/>
- <param name="xml-source-root" value="${guide.name}.xml"/>
- <param name="pdf-target-file"
- value="${docs.dist.dir}/doc/${guide.name}.pdf"/>
- </antcall>
- -->
-
- </target>
-
- <target name="test-pdf"
- depends="init"
- description="test pdf build of [prog|dev|adk]guide"
- >
- <!-- NPE in fop task when building programming guide.
- see patch at https://bugs.eclipse.org/bugs/show_bug.cgi?id=81654
- <antcall target="build-pdf">
- <param name="guide.dir" value="progGuideDB" />
- <param name="guide.name" value="progguide" />
- </antcall>
- -->
- <antcall target="build-pdf">
- <param name="guide.dir" value="adk15ProgGuideDB" />
- <param name="guide.name" value="adk15notebook" />
- </antcall>
- <copy todir="${docs.src.dir}/devGuideDB" filtering="off">
- <fileset dir="${devguide.icons.dir}"
- includes="${include.devguide.icons}"
- />
- </copy>
-
- <antcall target="build-pdf">
- <param name="xml-html-copy"
- value="ajbrowser-building.gif,ajbrowser-options.gif,${include.devguide.icons}"
- />
- <param name="guide.dir" value="devGuideDB" />
- <param name="guide.name" value="devguide" />
- </antcall>
- </target>
-
- <target name="build-pdf"
- depends="init"
- description="build prog or dev guide, using guide.dir and guide.name"
- >
- <antcall target="xml-pdf">
- <param name="xml-source-dir"
- value="${docs.src.dir}/${guide.dir}"
- />
- <param name="xml-source-root" value="${guide.name}.xml" />
- <param name="pdf-target-file"
- value="${docs.dist.dir}/doc/${guide.name}.pdf"
- />
- </antcall>
- </target>
-
- <!-- XML conversion stuff -->
-
- <!-- xml-pdf -->
- <target name="xml-pdf">
- <delete file="${pdf-target-file}" />
- <touch file="${pdf-target-file}" />
- <delete file="${xml-source-dir}/index.fo" />
-
- <!-- produce index.fo from docbook sources -->
- <java classname="com.icl.saxon.StyleSheet" fork="yes">
- <classpath>
- <pathelement location="${aspectj.modules.lib.dir}/saxon/saxon.jar"
- />
- </classpath>
- <arg value="-o" />
- <arg value="${xml-source-dir}/index.fo" />
- <arg value="${xml-source-dir}/${xml-source-root}" />
- <arg value="${aspectj.modules.lib.dir}/docbook/docbook-xsl/fo/docbook.xsl"
- />
- </java>
-
- <!-- index.fo to pdf (TODO if formatting fixed, to init-taskdefs) -->
- <taskdef name="fop"
- classname="org.apache.fop.tools.anttasks.Fop"
- >
- <classpath>
- <fileset dir="${aspectj.modules.lib.dir}/docbook/fop">
- <include name="fop.jar" />
- <include name="batik.jar" />
- <include name="avalon.jar" />
- </fileset>
- <fileset dir="${aspectj.modules.lib.dir}/ant">
- <include name="xalan.jar" />
- <include name="xercesImpl.jar" />
- <include name="xml-apis.jar" />
- </fileset>
- </classpath>
- </taskdef>
- <!-- TODO messagelevel="info" -->
- <fop format="application/pdf"
- messagelevel="verbose"
- basedir="${guide.dir}"
- fofile="${guide.dir}/index.fo"
- outfile="${pdf-target-file}"
- >
- </fop>
- <delete quiet="on" file="${guide.dir}/index.fo" />
- </target>
-
- <target name="xml-html"
- description="antcall(xml-source-dir, xml-source-root, xml-target-dir, xml-target-file)
- convert xml to html using docbook. parameters:
- xml-source-dir # base directory of source
- xml-source-root # base file of source (relative to xml-source-dir)
- xsl-source-file # xsl transform to apply (use chunk.xsl.source by default)
- xml-target-dir # target directory for output (used as xsl param base.dir)
- xml-target-file # full path to output file in xml-source-dir, ignored when chunking
- xml-html-copy # copy files to target (defaults to *.gif,*.png"
- >
-
- <mkdir dir="${xml-target-dir}" />
- <copy todir="${xml-target-dir}">
- <fileset dir="${xml-source-dir}"
- includes="${xml-html-copy}"
- />
- </copy>
- <java classname="com.icl.saxon.StyleSheet"
- classpath="${aspectj.modules.lib.dir}/saxon/saxon.jar"
- fork="yes"
- failonerror="yes"
- >
- <!-- todo: establish failure policy -->
- <arg value="-o" />
- <arg value="${xml-target-file}" />
- <arg value="${xml-source-dir}/${xml-source-root}" />
- <arg value="${xsl-source-file}" />
- <arg value="base.dir=${xml-target-dir}/" />
- <arg value="use.id.as.filename=1" />
- </java>
- </target>
-
- </project>
|