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 |
|
---|
8 | <target name="transform.fo2pdf.xep.test-use">
|
---|
9 | <condition property="use.xep.pdf.formatter">
|
---|
10 | <equals arg1="${pdf.formatter}" arg2="xep"/>
|
---|
11 | </condition>
|
---|
12 | </target>
|
---|
13 |
|
---|
14 | <target name="transform.fo2pdf.xep.init" if="use.xep.pdf.formatter">
|
---|
15 | <condition property="use.xep.pdf.formatter">
|
---|
16 | <equals arg1="${pdf.formatter}" arg2="xep"/>
|
---|
17 | </condition>
|
---|
18 |
|
---|
19 | <!-- default output format -->
|
---|
20 | <condition property="xep.formatter.output-format" value="PDF">
|
---|
21 | <not><isset property="xep.formatter.output-format"/></not>
|
---|
22 | </condition>
|
---|
23 | <!-- output file extension -->
|
---|
24 | <condition property="xsl.formatter.ext" value=".ps">
|
---|
25 | <and>
|
---|
26 | <equals arg1="${xep.formatter.output-format}" arg2="PostScript"/>
|
---|
27 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
28 | </and>
|
---|
29 | </condition>
|
---|
30 | <condition property="xsl.formatter.ext" value=".html">
|
---|
31 | <and>
|
---|
32 | <equals arg1="${xep.formatter.output-format}" arg2="XHTML"/>
|
---|
33 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
34 | </and>
|
---|
35 | </condition>
|
---|
36 | <condition property="xsl.formatter.ext" value=".AT.xml">
|
---|
37 | <and>
|
---|
38 | <equals arg1="${xep.formatter.output-format}" arg2="XEP"/>
|
---|
39 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
40 | </and>
|
---|
41 | </condition>
|
---|
42 | <!--condition property="xsl.formatter.ext" value=".AT.xml">
|
---|
43 | <and>
|
---|
44 | <equals arg1="${xep.formatter.output-format}" arg2="AT"/>
|
---|
45 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
46 | </and>
|
---|
47 | </condition-->
|
---|
48 | <condition property="xsl.formatter.ext" value=".svg">
|
---|
49 | <and>
|
---|
50 | <equals arg1="${xep.formatter.output-format}" arg2="SVG"/>
|
---|
51 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
52 | </and>
|
---|
53 | </condition>
|
---|
54 | <condition property="xsl.formatter.ext" value=".xps">
|
---|
55 | <and>
|
---|
56 | <equals arg1="${xep.formatter.output-format}" arg2="XPS"/>
|
---|
57 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
58 | </and>
|
---|
59 | </condition>
|
---|
60 | <condition property="xsl.formatter.ext" value=".afp">
|
---|
61 | <and>
|
---|
62 | <equals arg1="${xep.formatter.output-format}" arg2="AFP"/>
|
---|
63 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
64 | </and>
|
---|
65 | </condition>
|
---|
66 | <condition property="xsl.formatter.ext" value=".ppml">
|
---|
67 | <and>
|
---|
68 | <equals arg1="${xep.formatter.output-format}" arg2="PPML"/>
|
---|
69 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
70 | </and>
|
---|
71 | </condition>
|
---|
72 | <condition property="xsl.formatter.ext" value=".pdf">
|
---|
73 | <and>
|
---|
74 | <equals arg1="${xep.formatter.output-format}" arg2="PDF"/>
|
---|
75 | <not><isset property="xsl.formatter.ext"/></not>
|
---|
76 | </and>
|
---|
77 | </condition>
|
---|
78 | </target>
|
---|
79 |
|
---|
80 | <!-- run XEP -->
|
---|
81 | <target name="transform.fo2pdf.xep" depends="transform.fo2pdf.xep.test-use, transform.fo2pdf.xep.init" if="use.xep.pdf.formatter">
|
---|
82 | <property name="xep.dir" value="${fo.lib.dir}/xep"/>
|
---|
83 |
|
---|
84 | <condition property="xep.config.file" value="${custom.xep.config}">
|
---|
85 | <isset property="custom.xep.config"/>
|
---|
86 | </condition>
|
---|
87 | <condition property="xep.config.file" value="${xep.dir}/xep.xml">
|
---|
88 | <not><isset property="custom.xep.config"/></not>
|
---|
89 | </condition>
|
---|
90 |
|
---|
91 | <path id="xep.class.path">
|
---|
92 | <fileset dir="${xep.dir}/lib" includes="**/*.jar"/>
|
---|
93 | <pathelement location="${fo.lib.dir}/fo.jar"/>
|
---|
94 | </path>
|
---|
95 |
|
---|
96 | <condition property="xep.failOnError" value="false">
|
---|
97 | <not><isset property="xep.failOnError"/></not>
|
---|
98 | </condition>
|
---|
99 |
|
---|
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 |
|
---|
105 | <java classname="com.idiominc.ws.opentopic.fo.xep.Runner" resultproperty="errCode"
|
---|
106 | failonerror="${xep.failOnError}" fork="true" maxmemory="${maxJavaMemory}">
|
---|
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 | </java>
|
---|
115 | <condition property="xepExitedOnError" value="true">
|
---|
116 | <not><equals arg1="${errCode}" arg2="0"/></not>
|
---|
117 | </condition>
|
---|
118 | </target>
|
---|
119 |
|
---|
120 | </project>
|
---|