| <project default="generate"> |
| |
| <property name="deploy-folder" value="/home/data/httpd/download.eclipse.org/rmf/documentation"/> |
| |
| <target name="generate" depends="copy"> |
| <antcall target="generate-pdf" /> |
| <antcall target="generate-html" /> |
| <antcall target="deploy" /> |
| </target> |
| |
| <target name="copy"> |
| <copy todir="${basedir}/build"> |
| <fileset dir="${basedir}" includes="rmf-latex/**"/> |
| <fileset dir="${basedir}" includes="rmf-images/**"/> |
| </copy> |
| </target> |
| |
| <target name="generate-html"> |
| <exec executable="htlatex" dir="${basedir}/build/rmf-latex"> |
| <arg value="main"/> |
| <arg value="html,3,next,frames"/> |
| </exec> |
| <antcall target="tweak-css" /> |
| <antcall target="tweak-html" /> |
| </target> |
| |
| <target name="tweak-css"> |
| <replace |
| file="${basedir}/build/rmf-latex/main.css" |
| token="body#tex4ht-menu {white-space: nowrap; }" |
| value="body#tex4ht-menu {white-space: nowrap; background-color:#eee;}"/> |
| </target> |
| |
| <target name="tweak-html"> |
| <replace |
| file="${basedir}/build/rmf-latex/main2.html" |
| token="</body></html>" |
| value="<br/><br/><a href='main.pdf'>Download as PDF</a></body></html>"/> |
| </target> |
| |
| <target name="generate-pdf"> |
| <!-- Needs to run twice to get cross-references right --> |
| <exec executable="pdflatex" dir="${basedir}/build/rmf-latex"><arg value="main"/></exec> |
| <exec executable="pdflatex" dir="${basedir}/build/rmf-latex"><arg value="main"/></exec> |
| <exec executable="pdflatex" dir="${basedir}/build/rmf-latex"><arg value="main"/></exec> |
| </target> |
| |
| <target name="deploy-folder.present"> |
| <available |
| file="${deploy-folder}" |
| type="dir" |
| property="deploy-folder.present"/> |
| </target> |
| |
| <target name="deploy" depends="deploy-folder.present" if="deploy-folder.present"> |
| <echo message="Deploy Folder exists: Deploying..."/> |
| <copy todir="${deploy-folder}"> |
| <fileset dir="${basedir}/build/" includes="**/*"/> |
| </copy> |
| </target> |
| |
| </project> |