plugin-antpreprocess.dita 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <task id="plugin-antpreprocess" xml:lang="en-US">
  5. <title>Adding an Ant target to the pre-processing pipeline</title>
  6. <shortdesc>You can add an Ant target to the pre-processing pipeline. This enables you to insert additional processing
  7. before or after the pre-processing chain or a specific step in the pre-processing operation.</shortdesc>
  8. <prolog>
  9. <metadata>
  10. <keywords>
  11. <indexterm>plug-ins<indexterm>Ant</indexterm></indexterm>
  12. <indexterm>Ant<indexterm>preprocessing</indexterm></indexterm>
  13. </keywords>
  14. </metadata>
  15. </prolog>
  16. <taskbody>
  17. <context>
  18. <p>You can use the <codeph>depend.preprocess.pre</codeph> and <codeph>depend.preprocess.post</codeph> extension
  19. points to run a target before or after the entire pre-processing operation. In addition, there are extension
  20. points that enable you to run an Ant target before specific pre-processing steps.</p>
  21. <note conref="../resources/conref-task.dita#ID/tip-extend-before-after-preprocessing"/>
  22. </context>
  23. <steps>
  24. <step>
  25. <cmd>Define and integrate the new Ant target.</cmd>
  26. </step>
  27. <step>
  28. <cmd>Create the following <filepath>plugin.xml</filepath> file:</cmd>
  29. <info><codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;plugin id="<varname>plugin-id</varname>">
  30. &lt;feature extension="<varname>extension-point</varname>" value="<varname>Ant-target</varname>"/>
  31. &lt;/plugin></codeblock>where
  32. <ul>
  33. <li><varname>plugin-id</varname> is the plug-in identifier.</li>
  34. <li><varname>extension-point</varname> is a pre-processing extension point.</li>
  35. <li><varname>Ant-target</varname> is the name of the Ant target.</li>
  36. </ul></info>
  37. </step>
  38. <step>
  39. <cmd>Install the plug-in.</cmd>
  40. </step>
  41. </steps>
  42. <result>The new target is added to the Ant dependency list. The new target is now always run in conjunction with the
  43. specified step in the pre-processing pipeline.</result>
  44. <example>
  45. <title>Example</title>
  46. <p>The following <filepath>plugin.xml</filepath> file specifies that the
  47. <parmname>myAntTargetBeforeChunk</parmname> target is always run before the <codeph>chunk</codeph> step in the
  48. pre-processing stage.</p>
  49. <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;plugin id="com.example.extendchunk">
  50. &lt;feature extension="depend.preprocess.chunk.pre"
  51. value="myAntTargetBeforeChunk"/>
  52. &lt;/plugin></codeblock>
  53. <p>It assumes that the <parmname>myAntTargetBeforeChunk</parmname> target has already been defined and
  54. integrated.</p>
  55. <note conref="../resources/conref-task.dita#ID/caution-extend-within-preprocessing"/>
  56. </example>
  57. </taskbody>
  58. </task>