1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
<?xml version="1.0" ?>
<project name="Red5 Documentation" basedir="." default="doc-all">
<property name="doc.ref.dir" value="${basedir}"/>
<property name="doc.ref.lib" value="${doc.ref.dir}/lib"/>
<!-- base project properties -->
<property file="${basedir}/build.properties"/>
<!-- XSLT task because default is not customizable -->
<macrodef name="dbxslt">
<attribute name="xincludes" default="true"/>
<attribute name="out" default=""/>
<attribute name="in" default=""/>
<attribute name="style" default=""/>
<attribute name="basedir" default="${doc.ref.dir}"/>
<attribute name="params" default=""/>
<sequential>
<condition property="xslt.out" value="" else="-o @{out}">
<length string="@{out}" trim="true" length="0"/>
</condition>
<condition property="xslt.xincludes" value="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"
else="">
<equals arg1="@{xincludes}" arg2="true"/>
</condition>
<java classname="com.icl.saxon.StyleSheet" fork="true" dir="@{basedir}">
<classpath>
<pathelement location="/usr/share/java/saxon.jar"/>
<pathelement location="/usr/share/java/xercesImpl.jar"/>
<pathelement location="/usr/share/java/xmlParserAPIs.jar"/>
</classpath>
<jvmarg line="${xslt.xincludes}"/>
<jvmarg value="-Dxslthl.config=file:///usr/share/xml/docbook/stylesheet/nwalsh/highlighting/xslthl-config.xml"/>
<jvmarg value="-Xms128m"/>
<jvmarg value="-Xmx512m"/>
<arg line="${xslt.out} @{in} @{style} @{params}"/>
</java>
</sequential>
</macrodef>
<!-- FOP Task because default cannot send memory args -->
<macrodef name="fop-pdf">
<attribute name="basedir" default="."/>
<attribute name="fofile" default=""/>
<attribute name="outfile" default=""/>
<sequential>
<java classname="org.apache.fop.cli.Main" dir="@{basedir}" fork="true" failonerror="true"
classpathref="doc.lib.classpath">
<sysproperty key="java.awt.headless" value="true"/>
<jvmarg value="-Xms128m"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog"/>
<arg value="-fo"/>
<arg path="@{fofile}"/>
<arg value="-pdf"/>
<arg path="@{outfile}"/>
</java>
</sequential>
</macrodef>
<!-- Check if Docbook libraries are installed -->
<target name="doc-prepare" description="Extra preparation for the documentation" unless="doc.prepare">
<path id="doc.lib.classpath">
<fileset dir="${doc.ref.lib}/docbook">
<include name="*.jar"/>
</fileset>
<fileset dir="${doc.ref.lib}/tracwiki2docbook">
<include name="*.jar"/>
</fileset>
</path>
<sequential>
<get src="http://red5.electroteque.org/doc/reference/docbook-reference-libs.tar.bz2"
dest="${doc.ref.dir}/docbook-reference-libs.tar.bz2"
verbose="true"
usetimestamp="true"/>
<untar compression="bzip2" src="${doc.ref.dir}/docbook-reference-libs.tar.bz2" dest="${doc.ref.dir}/" overwrite="false"/>
</sequential>
<property name="doc.prepare" value="true"/>
</target>
<!-- Clean doc source -->
<target name="doc-clean" >
<delete>
<fileset dir="${doc.ref.dir}" includes="pdf/*.pdf"/>
<fileset dir="${doc.ref.dir}" includes="html/**.html"/>
<fileset dir="${doc.ref.dir}" includes="html_single/**.html"/>
</delete>
</target>
<target name="doc-all" depends="doc-prepare" description="Generate all reference documentation">
<sequential>
<antcall target="doc-clean" inheritAll="true" inheritRefs="true"/>
<antcall target="doc-pdf" inheritAll="true" inheritRefs="true"/>
<antcall target="doc-html" inheritAll="true" inheritRefs="true"/>
</sequential>
</target>
<!-- PDF Documentation -->
<target name="doc-pdf" description="Compile reference documentation in PDF format">
<path id="doc.lib.classpath">
<fileset dir="${doc.ref.lib}/docbook">
<include name="*.jar"/>
</fileset>
<fileset dir="${doc.ref.lib}/tracwiki2docbook">
<include name="*.jar"/>
</fileset>
</path>
<!-- Build fo file -->
<mkdir dir="${doc.ref.dir}/pdf"/>
<dbxslt basedir="${doc.ref.dir}/src" in="${doc.ref.dir}/src/${locale}/book.xml"
out="${doc.ref.dir}/src/docbook_fop.tmp" style="${doc.ref.dir}/styles/fopdf.xsl"/>
<!-- Build pdf -->
<fop-pdf basedir="${doc.ref.dir}/src" fofile="${doc.ref.dir}/src/docbook_fop.tmp"
outfile="${doc.ref.dir}/pdf/red5-reference-0.9.pdf"/>
<delete file="${doc.ref.dir}/src/docbook_fop.tmp"/>
</target>
<!-- HTML Site Documentation -->
<target name="doc-html" description="Compile reference documentation in HTML format">
<path id="doc.lib.classpath">
<fileset dir="${doc.ref.lib}/docbook">
<include name="*.jar"/>
</fileset>
<fileset dir="${doc.ref.lib}/tracwiki2docbook">
<include name="*.jar"/>
</fileset>
</path>
<mkdir dir="${doc.ref.dir}/html"/>
<mkdir dir="${doc.ref.dir}/html/images"/>
<copy todir="${doc.ref.dir}/html/images">
<fileset dir="${doc.ref.dir}/src/${locale}/images">
<include name="*.gif"/>
<include name="*.svg"/>
<include name="*.jpg"/>
<include name="*.png"/>
</fileset>
</copy>
<copy todir="${doc.ref.dir}/html/" failonerror="false">
<fileset dir="${doc.ref.dir}/styles/">
<include name="*.css"/>
<include name="*.js"/>
</fileset>
</copy>
<dbxslt basedir="${doc.ref.dir}/html/" in="${doc.ref.dir}/src/${locale}/book.xml"
style="${doc.ref.dir}/styles/html_chunk.xsl"/>
</target>
<!-- HTML Single Documentation -->
<target name="doc-html-single" depends="doc-prepare" description="Compile reference documentation in single page HTML format">
<mkdir dir="${doc.ref.dir}/html"/>
<mkdir dir="${doc.ref.dir}/html_single/images"/>
<copy todir="${doc.ref.dir}/html_single/images">
<fileset dir="${doc.ref.dir}/src/${locale}/images">
<include name="*.gif"/>
<include name="*.svg"/>
<include name="*.jpg"/>
<include name="*.png"/>
</fileset>
</copy>
<copy todir="${doc.ref.dir}/html_single/" file="${doc.ref.dir}/styles/html.css"
failonerror="false"/>
<dbxslt basedir="${doc.ref.dir}/html_single/" in="${doc.ref.dir}/src/${locale}/index.xml"
out="${doc.ref.dir}/html_single/index.html" style="${doc.ref.dir}/styles/html.xsl"/>
</target>
</project>
|