From: Steve F. <sm...@us...> - 2002-08-05 01:28:32
|
Update of /cvsroot/mockobjects/no-stone-unturned In directory usw-pr-cvs1:/tmp/cvs-serv8684 Modified Files: build.xml Log Message: Added support for building arbitrary fragments. Index: build.xml =================================================================== RCS file: /cvsroot/mockobjects/no-stone-unturned/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- build.xml 4 Aug 2002 11:13:08 -0000 1.2 +++ build.xml 5 Aug 2002 01:28:29 -0000 1.3 @@ -69,46 +69,30 @@ dest="${xdoc.dtd.dir}" /> </target> - <target name="_prepare-xdoc" - depends="CallMeFirst"> - <!-- requires prepare.xdoc.dir, book.xml.file --> - <mkdir dir="${prepare.xdoc.dir}"/> - - <!-- Copy files with filtering --> - <filter token="docpath" value="${basedir}/${prepare.xdoc.dir}"/> - <filter token="xslpath" value="${basedir}/${xsl.dir}"/> - <copy file="${xdoc.dir}/${book.xml.file}" - filtering="on" - overwrite="true" - tofile="${prepare.xdoc.dir}/book.xml"/> - <copy file="${xdoc.dir}/htmlbook.xsl" - filtering="on" - overwrite="true" - todir="${prepare.xdoc.dir}"/> + <target name="PrepareXFiles" + depends="CallMeFirst, unpack-xsl"> + <mkdir dir="${out.xdoc.dir}"/> - <!-- Copy all remaining files from ${xdoc.dir} to ${out.xdoc.dir} --> - <copy todir="${prepare.xdoc.dir}"> - <fileset dir="${xdoc.dir}"> - <exclude name="*-book.xml"/> - <include name="*.xml"/> - </fileset> - </copy> + <!-- Copy all remaining files from ${xdoc.dir} to ${out.xdoc.dir} --> + <copy todir="${out.xdoc.dir}"> + <fileset dir="${xdoc.dir}"> + <exclude name="*-book.xml"/> + <exclude name="extra_entities.xml"/> + <exclude name="_template.xml"/> + <include name="*.xml"/> + </fileset> + </copy> - <antcall target="_UnpackDtd"> - <param name="xdoc.dtd.dir" value="${prepare.xdoc.dir}/dtd" /> - </antcall> + <antcall target="_UnpackDtd"> + <param name="xdoc.dtd.dir" value="${out.xdoc.dir}/dtd" /> + </antcall> </target> - <target name="prepare-book" - depends="CallMeFirst, unpack-xsl"> + <target name="CopyOtherFiles" + depends="CallMeFirst"> <mkdir dir="${out.doc.dir}"/> <mkdir dir="${out.doc.dir}/images"/> - <antcall target="_prepare-xdoc"> - <param name="prepare.xdoc.dir" value="${out.xdoc.dir}"/> - <param name="book.xml.file" value="doc-book.xml"/> - </antcall> - <!-- Copy the images --> <copy todir="${out.doc.dir}/images"> <fileset dir="${xdoc.dir}/images"/> @@ -127,8 +111,37 @@ </copy> </target> + <target name="_CopyFilesWithFiltering"> + <!-- requires source.xml.file, target.xml.file --> + + <filter token="docpath" value="${basedir}/${out.xdoc.dir}"/> + <filter token="xslpath" value="${basedir}/${xsl.dir}"/> + <filter token="fragment.name" value="${fragment.name}"/> + <filter token="element" value="${element}"/> + <copy file="${xdoc.dir}/${source.xml.file}" + filtering="on" + overwrite="true" + tofile="${out.xdoc.dir}/${target.xml.file}"/> + <copy file="${xdoc.dir}/extra_entities.xml" + filtering="on" + overwrite="true" + todir="${out.xdoc.dir}"/> + <copy file="${xdoc.dir}/htmlbook.xsl" + filtering="on" + overwrite="true" + todir="${out.xdoc.dir}"/> + </target> + + <target name="PrepareBook" + depends="CallMeFirst, PrepareXFiles, CopyOtherFiles"> + <antcall target="_CopyFilesWithFiltering"> + <param name="source.xml.file" value="doc-book.xml"/> + <param name="target.xml.file" value="book.xml"/> + </antcall> + </target> + <target name="html-book" - depends="prepare-book" + depends="PrepareBook" description="Generate book as a single HTML file."> <delete file="${out.doc.dir}/book.html" /> @@ -139,6 +152,32 @@ style="${out.xdoc.dir}/htmlbook.xsl" processor="trax" /> </target> + + <target name="CheckFragmentProperties"> + <fail unless="fragment.name" message="Requires -Dfragment.name=<fragment name>" /> + <fail unless="element" message="Requires -Delement=<element type>" /> + </target> + + <target name="PrepareFragment" + depends="CallMeFirst, PrepareXFiles, CopyOtherFiles"> + <antcall target="_CopyFilesWithFiltering"> + <param name="source.xml.file" value="_template.xml"/> + <param name="target.xml.file" value="_template.xml"/> + </antcall> + </target> + + <target name="html-fragment" + depends="CheckFragmentProperties, PrepareFragment" + description="Generate part of a book as a single HTML file."> + + <delete file="${out.doc.dir}/${fragment.name}.html" /> + + <xslt basedir="${out.xdoc.dir}" + in="${out.xdoc.dir}/_template.xml" + out="${out.doc.dir}/${fragment.name}.html" + style="${out.xdoc.dir}/htmlbook.xsl" + processor="trax" /> + </target> <target name="clean" depends="CallMeFirst" |