build_dita2troff.xml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. Copyright 2006 IBM Corporation
  5. See the accompanying LICENSE file for applicable license.
  6. -->
  7. <project name="dita2troff">
  8. <target name="dita2troff-ast.init">
  9. <property name="troff-ast.xsl" location="${dita.plugin.org.dita.troff.dir}/xsl/dita2troff-ast-shell.xsl"/>
  10. </target>
  11. <target name="dita2troff.init">
  12. <property name="out.ext" value=".cli"/>
  13. <property name="troff.step2.xsl" location="${dita.plugin.org.dita.troff.dir}/xsl/dita2troff-step2-shell.xsl"/>
  14. </target>
  15. <target name="dita2troff"
  16. depends="dita2troff-ast.init, dita2troff.init, build-init, preprocess, dita.topic.troff-ast, dita.topic.troff, dita.inner.topic.troff">
  17. </target>
  18. <target name="dita.topic.troff-ast" unless="noTopic" depends="dita2troff-ast.init"
  19. description="Build Troff-specific AST output from dita topics.">
  20. <xslt basedir="${dita.temp.dir}"
  21. destdir="${dita.temp.dir}" includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}"
  22. extension=".dita"
  23. classpathref="dost.class.path"
  24. style="${troff-ast.xsl}">
  25. <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
  26. <param name="defaultLanguage" expression="${default.language}"/>
  27. <mapper type="glob" from="*" to="*.ast" />
  28. <xmlcatalog refid="dita.catalog"/>
  29. </xslt>
  30. <move todir="${dita.temp.dir}">
  31. <fileset dir="${dita.temp.dir}" includes="**/*.ast" />
  32. <mapper type="glob" from="*.ast" to="*" />
  33. </move>
  34. </target>
  35. <target name="dita.topic.troff" unless="noTopic" if="old.transform"
  36. description="Build troff output from dita inner and outer topics,which will adjust the directory.">
  37. <xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}"
  38. includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}" extension="${out.ext}"
  39. classpathref="dost.class.path"
  40. style="${troff.step2.xsl}">
  41. <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
  42. <param name="OUTFORMAT" expression="${troff.outformat}" if="troff.outformat"/>
  43. <param name="defaultLanguage" expression="${default.language}"/>
  44. <mapper classname="org.dita.dost.ant.types.JobMapper" to="${out.ext}"/>
  45. <xmlcatalog refid="dita.catalog"/>
  46. </xslt>
  47. </target>
  48. <!--The new solution which divides the whole process into the inner and outer steps -->
  49. <target name="dita.inner.topic.troff" unless="noTopic" if="inner.transform"
  50. description="Build troff output from inner dita topics">
  51. <echo level="info">the ditmapoutputdir is ${dita.map.output.dir}</echo>
  52. <!-- step 2 -->
  53. <xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}"
  54. includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}" extension="${out.ext}"
  55. classpathref="dost.class.path"
  56. style="${troff.step2.xsl}">
  57. <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
  58. <param name="OUTFORMAT" expression="${troff.outformat}" if="troff.outformat"/>
  59. <mapper classname="org.dita.dost.ant.types.JobMapper" to="${out.ext}"/>
  60. <xmlcatalog refid="dita.catalog"/>
  61. </xslt>
  62. </target>
  63. </project>