dita-cmd.xml 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  3. <project basedir="." name="dita-cmd">
  4. <description>Defines a dita-cmd macro you can use in your Ant builds. See build-chm-pdf-hybrid.xml for
  5. usage.</description>
  6. <property name="dita.dir" location="${basedir}/../../.."/>
  7. <macrodef name="dita-cmd">
  8. <attribute name="input"/>
  9. <attribute name="format"/>
  10. <attribute name="propertyfile"/>
  11. <sequential>
  12. <!-- For Unix run the DITA executable-->
  13. <exec taskname="dita-cmd" executable="${dita.dir}/bin/dita" osfamily="unix" failonerror="true">
  14. <arg value="--input"/>
  15. <arg value="@{input}"/>
  16. <arg value="--format"/>
  17. <arg value="@{format}"/>
  18. <arg value="--propertyfile"/>
  19. <arg value="@{propertyfile}"/>
  20. </exec>
  21. <!-- For Windows run DITA from a DOS command -->
  22. <exec taskname="dita-cmd" dir="${dita.dir}/bin" executable="cmd" osfamily="windows" failonerror="true">
  23. <arg value="/C"/>
  24. <arg value="dita --input @{input} --format @{format} --propertyfile=@{propertyfile}"/>
  25. </exec>
  26. </sequential>
  27. </macrodef>
  28. </project>