build_xep.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?xml version="1.0"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. See the accompanying license.txt file for applicable licenses.
  5. -->
  6. <project name="org.dita.pdf2.xep">
  7. <target name="transform.fo2pdf.xep.test-use">
  8. <condition property="use.xep.pdf.formatter">
  9. <equals arg1="${pdf.formatter}" arg2="xep"/>
  10. </condition>
  11. </target>
  12. <target name="transform.fo2pdf.xep.init" depends="transform.fo2pdf.xep.test-use" if="use.xep.pdf.formatter">
  13. <condition property="use.xep.pdf.formatter">
  14. <equals arg1="${pdf.formatter}" arg2="xep"/>
  15. </condition>
  16. <condition property="temp.transformation.file" value="${dita.plugin.org.dita.pdf2.xep.dir}/xsl/fo/topic2fo_shell_xep.xsl">
  17. <and>
  18. <not><isset property="args.xsl.pdf"/></not>
  19. <isset property="use.xep.pdf.formatter"/>
  20. </and>
  21. </condition>
  22. <!-- default output format -->
  23. <condition property="xep.formatter.output-format" value="PDF">
  24. <not><isset property="xep.formatter.output-format"/></not>
  25. </condition>
  26. <!-- output file extension -->
  27. <condition property="xsl.formatter.ext" value=".ps">
  28. <and>
  29. <equals arg1="${xep.formatter.output-format}" arg2="PostScript"/>
  30. <not><isset property="xsl.formatter.ext"/></not>
  31. </and>
  32. </condition>
  33. <condition property="xsl.formatter.ext" value=".html">
  34. <and>
  35. <equals arg1="${xep.formatter.output-format}" arg2="XHTML"/>
  36. <not><isset property="xsl.formatter.ext"/></not>
  37. </and>
  38. </condition>
  39. <condition property="xsl.formatter.ext" value=".AT.xml">
  40. <and>
  41. <equals arg1="${xep.formatter.output-format}" arg2="XEP"/>
  42. <not><isset property="xsl.formatter.ext"/></not>
  43. </and>
  44. </condition>
  45. <!--condition property="xsl.formatter.ext" value=".AT.xml">
  46. <and>
  47. <equals arg1="${xep.formatter.output-format}" arg2="AT"/>
  48. <not><isset property="xsl.formatter.ext"/></not>
  49. </and>
  50. </condition-->
  51. <condition property="xsl.formatter.ext" value=".svg">
  52. <and>
  53. <equals arg1="${xep.formatter.output-format}" arg2="SVG"/>
  54. <not><isset property="xsl.formatter.ext"/></not>
  55. </and>
  56. </condition>
  57. <condition property="xsl.formatter.ext" value=".xps">
  58. <and>
  59. <equals arg1="${xep.formatter.output-format}" arg2="XPS"/>
  60. <not><isset property="xsl.formatter.ext"/></not>
  61. </and>
  62. </condition>
  63. <condition property="xsl.formatter.ext" value=".afp">
  64. <and>
  65. <equals arg1="${xep.formatter.output-format}" arg2="AFP"/>
  66. <not><isset property="xsl.formatter.ext"/></not>
  67. </and>
  68. </condition>
  69. <condition property="xsl.formatter.ext" value=".ppml">
  70. <and>
  71. <equals arg1="${xep.formatter.output-format}" arg2="PPML"/>
  72. <not><isset property="xsl.formatter.ext"/></not>
  73. </and>
  74. </condition>
  75. <condition property="xsl.formatter.ext" value=".pdf">
  76. <and>
  77. <equals arg1="${xep.formatter.output-format}" arg2="PDF"/>
  78. <not><isset property="xsl.formatter.ext"/></not>
  79. </and>
  80. </condition>
  81. </target>
  82. <!-- run XEP -->
  83. <target name="transform.fo2pdf.xep" if="use.xep.pdf.formatter">
  84. <property name="xep.dir" value="${dita.plugin.org.dita.pdf2.xep.dir}/lib/xep"/>
  85. <condition property="xep.config.file" value="${custom.xep.config}">
  86. <isset property="custom.xep.config"/>
  87. </condition>
  88. <condition property="xep.config.file" value="${xep.dir}/xep.xml">
  89. <not><isset property="custom.xep.config"/></not>
  90. </condition>
  91. <path id="xep.class.path">
  92. <fileset dir="${lib.dir}" includes="**/*.jar"/>
  93. <fileset dir="${xep.dir}/lib" includes="**/*.jar"/>
  94. <pathelement location="${fo.lib.dir}/fo.jar"/>
  95. <pathelement location="${dita.plugin.org.dita.pdf2.xep.dir}/lib/xep.jar"/>
  96. </path>
  97. <condition property="xep.failOnError" value="false">
  98. <not><isset property="xep.failOnError"/></not>
  99. </condition>
  100. <condition property="outputFile" value="${dita.map.output.dir}/${outputFile.base}${xsl.formatter.ext}">
  101. <not><isset property="outputFile"/></not>
  102. </condition>
  103. <mkdir dir="${dita.map.output.dir}"/>
  104. <echo level="info" taskname="xep">Processing ${pdf2.temp.dir}/topic.fo to ${outputFile}</echo>
  105. <java classname="com.idiominc.ws.opentopic.fo.xep.Runner" resultproperty="errCode"
  106. failonerror="${xep.failOnError}" fork="true" maxmemory="${maxJavaMemory}" taskname="xep">
  107. <jvmarg line="${baseJVMArgLine}"/>
  108. <arg value="${pdf2.temp.dir}/topic.fo"/>
  109. <arg value="${outputFile}"/>
  110. <arg value="failOnError=${xep.failOnError}"/>
  111. <arg value="-${xep.formatter.output-format}"/>
  112. <classpath refid="xep.class.path"/>
  113. <sysproperty key="com.renderx.xep.CONFIG" value="${xep.config.file}"/>
  114. <!--Set up catalog resolver with the DITA main catalog file, useful for solving for example SVG image DOCTYPES-->
  115. <sysproperty key="com.renderx.sax.entityresolver" value="org.apache.xml.resolver.tools.CatalogResolver"/>
  116. <sysproperty key="xml.catalog.files" value="${dita.dir}/catalog-dita.xml"/>
  117. </java>
  118. <condition property="xepExitedOnError" value="true">
  119. <not><equals arg1="${errCode}" arg2="0"/></not>
  120. </condition>
  121. </target>
  122. </project>