build.dita-ot.chm-pdf.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <project name="build-chm-pdf" default="all" basedir="../../.">
  3. <!--<property name="dita.dir" location="${basedir}/../../.."/>-->
  4. <tstamp>
  5. <format property="dita-ot.last.hour" pattern="MM/dd/yyyy hh:mm a" offset="-1" unit="hour"/>
  6. <format property="dita-ot.truncate_queue_if_spammed.condition.timestamp" pattern="MM/dd/yyyy hh:mm a" offset="-100" unit="minute"/>
  7. <format property="dita-ot.current.timestamp" pattern="yyyy-dd-MM-hh-mm-a" />
  8. </tstamp>
  9. <include file="build_dita-ot.input.xml" as="input" />
  10. <!--<include file="../system_ui_info_speech/build_system_ui_info_speech.xml" as="p5suis"/>-->
  11. <include file="../ant-contrib/build_ant-contrib.xml" as="ant-contrib"/>
  12. <include file="../apache_fop/build_apache_fop.xml"/>
  13. <target name="all" description="build CHM and PDF" depends="input.input,chm,pdf"/>
  14. <target name="finally" unless="finally_exception.cond" depends="finally_cond">
  15. <input addproperty="dita-ot.resultproperty.PARAM"/>
  16. <echo>Finally #16 $finally_exception.cond = ${finally_exception.cond}
  17. $dita-ot.resultproperty = ${dita-ot.resultproperty}
  18. $dita-ot.resultproperty.PARAM = ${dita-ot.resultproperty.PARAM} Wykonano pdf z mapy p5:file ${dita-ot.args.input.input} to ${dita-ot.output.dir.input}</echo>
  19. <antcall target="p5suis.p5suis:say_to_queue.PL">
  20. <param name="p5suis:say_text" value=" Wykonano pdf ${dita-ot.args.input.ditamap.title.info} z mapy p5:file ${dita-ot.args.input.input}"/>
  21. </antcall>
  22. <echo append="true" file="${dita-ot.output.complete.touch}">#144 Completed ${dita-ot.NOW} </echo>
  23. <delete dir="${dita-ot.temp.input}" verbose="yes" failonerror="no"/>
  24. <echo>#29 Copying file="${dita-ot.repository.pdf}" tofile="${dita-ot.local.pdf}" </echo>
  25. <copy file="${dita-ot.repository.pdf}" tofile="${dita-ot.local.pdf}" failonerror="no"/>
  26. </target>
  27. <target name="finally_cond">
  28. <condition property="finally_exception.cond">
  29. <not>
  30. <equals arg1="${dita-ot.resultproperty}" arg2="0" />
  31. </not>
  32. </condition>
  33. </target>
  34. <target name="finally_exception" if="finally_exception.cond" depends="finally_cond">
  35. <input addproperty="dita-ot.resultproperty.PARAM"/>
  36. <echo>Finally #279999 $finally_exception.cond = ${finally_exception.cond}
  37. repo src $dita-ot.repository.pdf = ${dita-ot.repository.pdf}
  38. local dst $dita-ot.local.pdf ${dita-ot.local.pdf}
  39. $dita-ot.resultproperty = ${dita-ot.resultproperty}
  40. $dita-ot.outputproperty = ${dita-ot.outputproperty}
  41. $dita-ot.resultproperty.PARAM = ${dita-ot.resultproperty.PARAM} nie wykonano pdf z mapy p5:file ${dita-ot.args.input.input} to ${dita-ot.output.dir.input}</echo>
  42. <antcall target="p5suis.p5suis:say_to_queue.PL">
  43. <param name="p5suis:say_text" value="Błąd tworzenia pdf ${dita-ot.args.input.ditamap.title.info} z mapy p5:file ${dita-ot.args.input.input}
  44. "/>
  45. </antcall>
  46. <!--SSS<exec executable="open">
  47. <arg file="${dita-ot.temp}/${dita-ot.args.input.input}"/>
  48. </exec>-->
  49. <!--SSS<exec executable="open">
  50. <arg file="${dita-ot.temp.input.topic.fo}"/>
  51. </exec>-->
  52. <!--
  53. <echoxml file="${dita-ot.temp.input.errorproperty.xml}">
  54. <dita-ot.temp.input.errorproperty.xml>
  55. ${dita-ot.errorproperty}
  56. </dita-ot.temp.input.errorproperty.xml>
  57. </echoxml>
  58. <echoxml file="${dita-ot.temp.input.resultproperty.xml}">
  59. <dita-ot.temp.input.resultproperty.xml>
  60. ${dita-ot.resultproperty}
  61. </dita-ot.temp.input.resultproperty.xml>
  62. </echoxml>
  63. <echoxml file="${dita-ot.temp.input.outputproperty.xml}">
  64. <dita-ot.temp.input.outputproperty.xml>
  65. ${dita-ot.outputproperty}
  66. </dita-ot.temp.input.outputproperty.xml>
  67. </echoxml>-->
  68. <!--<echo append="true" file="${output.complete.touch}">#144 Completed ${dita-ot.NOW} </echo>-->
  69. </target>
  70. <!--<target name="input">
  71. </target>-->
  72. <target name="chm" depends="input.input" description="build CHM">
  73. <ant antfile="${dita-ot.current-dita-ot.build}">
  74. <property name="args.input" location="${dita-ot.args.input.input}"/>
  75. <property name="transtype" value="htmlhelp"/>
  76. <property name="output.dir" location="../out/chm"/>
  77. <property name="args.gen.task.lbl" value="YES"/>
  78. </ant>
  79. </target>
  80. <target name="dita-ot.output.preparing.touch.if_exists">
  81. <condition property="dita-ot.output.preparing.touch.if_exists">
  82. <available file="${dita-ot.output.preparing.touch}"/>
  83. </condition>
  84. </target>
  85. <target name="dita-ot.output.error.touch.if_exists">
  86. <condition property="dita-ot.output.error.touch.if_exists">
  87. <available file="${dita-ot.output.error.touch}"/>
  88. </condition>
  89. </target>
  90. <target name="dita-ot.output.complete.touch.if_exists.message" if="dita-ot.output.complete.touch.if_exists">
  91. <echo>#86 already exists ${dita-ot.output.complete.touch} pdf generated</echo>
  92. </target>
  93. <target name="dita-ot.output.complete.touch.if_exists">
  94. <condition property="dita-ot.output.complete.touch.if_exists">
  95. <available file="${dita-ot.output.complete.touch}"/>
  96. </condition>
  97. </target>
  98. <target name="dita-ot.output.complete.touch.if_uptodate.delete" if="dita-ot.output.complete.touch.if_uptodate.cond">
  99. <echo>#85 deleting ${dita-ot.output.complete.touch} because dita-ot.output.complete.touch.if_uptodate.cond = ${dita-ot.output.complete.touch.if_uptodate.cond}</echo>
  100. <delete file="${dita-ot.output.complete.touch}"/>
  101. </target>
  102. <target name="dita-ot.output.complete.touch.if_uptodate" if="dita-ot.output.complete.touch.if_uptodate.if_exists" >
  103. <uptodate property="dita-ot.output.complete.touch.if_uptodate.cond" targetfile="${dita-ot.output.preparing.touch}" >
  104. <srcfiles file="${dita-ot.output.complete.touch}"/>
  105. </uptodate>
  106. </target>
  107. <target name="dita-ot.output.complete.touch.if_uptodate.if_exists" >
  108. <condition property="dita-ot.output.complete.touch.if_uptodate.if_exists">
  109. <available file="${dita-ot.output.complete.touch}"/>
  110. </condition>
  111. </target>
  112. <target name="dita-ot.output.preparing.touch">
  113. <echo append="true" file="${dita-ot.output.preparing.touch}">#114 Start Building Delivery ${dita-ot.NOW}
  114. dita-ot.temp.input.resultproperty.xml = ${dita-ot.temp.input.resultproperty.xml}
  115. dita-ot.temp.input.errorproperty.xml = ${dita-ot.temp.input.errorproperty.xml}
  116. </echo>
  117. </target>
  118. <target name="pdf.controller" depends="input.input,
  119. dita-ot.output.complete.touch.if_uptodate.if_exists,
  120. dita-ot.output.preparing.touch,
  121. dita-ot.output.complete.touch.if_uptodate,
  122. dita-ot.output.complete.touch.if_uptodate.delete,
  123. dita-ot.output.complete.touch.if_exists,
  124. dita-ot.output.preparing.touch.if_exists,
  125. dita-ot.output.error.touch.if_exists,
  126. dita-ot.output.complete.touch.if_exists.message,pdf.action,finally,finally_exception" unless="dita-ot.output.complete.touch.if_exists" description="build PDF" >
  127. </target>
  128. <target name="pdf" depends="pdf.controller"/>
  129. <target name="pdf.action" unless="dita-ot.output.complete.touch.if_exists" description="build PDF" > <!-- ant-contrib.init -->
  130. <tstamp>
  131. <format property="dita-ot.NOW" pattern="yyyy MMMM dd HH:mm:ss" locale="en"/>
  132. </tstamp>
  133. <echo>#20 will use settings
  134. $dita-ot.output.complete.touch = ${dita-ot.output.complete.touch}
  135. repo src $dita-ot.repository.pdf = ${dita-ot.repository.pdf}
  136. local dst $dita-ot.local.pdf ${dita-ot.local.pdf}
  137. $dita-ot.output.error.touch.if_exists = ${dita-ot.output.error.touch.if_exists} - ${dita-ot.output.error.touch}
  138. $dita-ot.output.preparing.touch.if_exists = ${dita-ot.output.preparing.touch.if_exists} - ${dita-ot.output.preparing.touch}
  139. $dita-ot.output.complete.touch.if_uptodate.cond = ${dita-ot.output.complete.touch.if_uptodate.cond}
  140. $dita-ot.output.complete.touch.if_exists = ${dita-ot.output.complete.touch.if_exists}
  141. $dita-ot.output.complete.touch.if_uptodate = ${dita-ot.output.complete.touch.if_uptodate}
  142. $dita-ot.temp.input = ${dita-ot.temp.input}
  143. $dita-ot.args.input.input = ${dita-ot.args.input.input}
  144. #### $dita-ot.output.dir.input = ${dita-ot.output.dir.input} ####
  145. $dita-ot.output.preparing.touch = ${dita-ot.output.preparing.touch}
  146. $dita-ot.output.error.touch = ${dita-ot.output.error.touch}
  147. $dita-ot.current-dita-ot.toolkit = ${dita-ot.current-dita-ot.toolkit}
  148. $dita-ot.current-dita-ot.lib = ${dita-ot.current-dita-ot.lib}
  149. $dita-ot.temp.input.errorproperty.xml = ${dita-ot.temp.input.errorproperty.xml}
  150. $dita-ot.temp.input.resultproperty.xml = ${dita-ot.temp.input.resultproperty.xml}
  151. ####
  152. </echo>
  153. <!-- The class which could not be loaded (org.dita.dost.module.GenMapAndTopicListModule)
  154. should be inside the dost.jar file. I don't have DITA-OT 1.6.3 installed,
  155. can you check please if [DITA-OT-1.6.3-install-dir]/lib/dost.jar includes this class?
  156. -->
  157. <!--<path id="dost.class.path">
  158. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.odt/lib/odt.jar"/>
  159. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.pdf2/lib/fo.jar"/>
  160. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.pdf2.axf/lib/axf.jar"/>
  161. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.pdf2.xep/lib/xep.jar"/>
  162. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.wordrtf/lib/wordrtf.jar"/>
  163. <pathelement location="${dita.dir}/lib/dost.jar"/>
  164. <pathelement location="${dita.dir}/lib/dost-configuration.jar"/>
  165. <pathelement location="${dita-ot.current-dita-ot.resolver.jar}"/>
  166. <pathelement location="${dita-ot.current-dita-ot.commons-codec-1.4.jar}"/>
  167. <pathelement location="${dita-ot.current-dita-ot.dost.jar}"/>
  168. <pathelement location="${dita-ot.current-dita-ot.icu4j.jar}"/>
  169. <pathelement location="${dita-ot.current-dita-ot.resolver.jar}"/>
  170. </path>-->
  171. <!-- <classloader classpath="${dita-ot.current-dita-ot.dost.jar}" /> <!-\- -\->
  172. <classloader classpath="${dita-ot.current-dita-ot.commons-codec-1.4.jar}" />
  173. <classloader classpath="${dita-ot.current-dita-ot.icu4j.jar}" />
  174. <classloader classpath="${dita-ot.current-dita-ot.resolver.jar}" />-->
  175. <echo>#54 adding taskdef antcontrib to add childs
  176. ${dita-ot.current-dita-ot.lib}
  177. ${dita-ot.current-dita-ot.dost.jar}
  178. ${dita-ot.current-dita-ot.commons-codec-1.4.jar}
  179. ${dita-ot.current-dita-ot.icu4j.jar}
  180. ${dita-ot.current-dita-ot.resolver.jar}
  181. </echo>
  182. <!-- <available classname="org.apache.commons.logging.LogConfigurationException" property="org.apache.commons.logging.LogConfigurationException.present"/>
  183. <available classname="org.dita.dost.module.GenMapAndTopicListModule" property="org.dita.dost.module.GenMapAndTopicListModule.present"/>
  184. <available classname="net.sf.antcontrib.properties" property="net.sf.antcontrib.properties.present"/>
  185. <available classname="net.sf.antcontrib.logic.AntCallBack" property="net.sf.antcontrib.logic.AntCallBack.present"/>
  186. <available classname="org/apache/xerces/xni/grammars/XMLGrammarPool" property="org.apache.xerces.xni.grammars.XMLGrammarPool.present"/>
  187. -->
  188. <!--<echo>
  189. #71 dostepne klasy
  190. $dita-ot.current-dita-ot.lib = ${dita-ot.current-dita-ot.lib}
  191. $org.apache.commons.logging.LogConfigurationException.present = ${org.apache.commons.logging.LogConfigurationException.present}
  192. $org.dita.dost.module.GenMapAndTopicListModule.present = ${org.dita.dost.module.GenMapAndTopicListModule.present}
  193. $net.sf.antcontrib.properties ${net.sf.antcontrib.properties.present}
  194. $net.sf.antcontrib.logic.AntCallBack.present = ${net.sf.antcontrib.logic.AntCallBack.present}
  195. dost.jar = ${dost.jar}
  196. org/apache/xerces/xni/grammars/XMLGrammarPool = ${org.apache.xerces.xni.grammars.XMLGrammarPool.present}
  197. </echo>-->
  198. <!-- jar="${ant-launcher.jar}" -->
  199. <taskdef resource="net/sf/antcontrib/antlib.xml"/>
  200. <!--<taskdef name="fop"
  201. classname="org.apache.fop.tools.anttasks.Fop">
  202. <classpath>
  203. <fileset dir="${apache_fop.current.home}/lib">
  204. <include name="*.jar"/>
  205. </fileset>
  206. <fileset dir="${apache_fop.current.home}/build">
  207. <include name="fop.jar"/>
  208. <include name="fop-hyph.jar" />
  209. </fileset>
  210. </classpath>
  211. </taskdef>-->
  212. <!--<taskdef name="org.apache.fop.tools.anttasks.Fop"
  213. classname="org.apache.fop.tools.anttasks.Fop">
  214. <classpath>
  215. <fileset dir="${dita-ot.current-dita-ot.lib}">
  216. <include name="fop.jar"/>
  217. <include name="batik-all-*.jar"/>
  218. <include name="commons-logging-*.jar"/>
  219. <include name="xmlgraphics-commons-*.jar"/>
  220. <include name="commons-io-*.jar"/>
  221. <include name="avalon-framework-*.jar"/>
  222. </fileset>
  223. </classpath>
  224. </taskdef>-->
  225. <!--
  226. <trycatch reference="exception_ref">
  227. <try>-->
  228. <echo>#113 Start Building Delivery</echo>
  229. <antcall target="p5suis.p5suis:say_to_queue.PL">
  230. <param name="p5suis:say_text" value="Tworzę pdf ${dita-ot.args.input.ditamap.title.info} z mapy p5:file ${dita-ot.args.input.input}"/>
  231. </antcall>
  232. <java dir="${dita-ot.current-dita-ot.toolkit}"
  233. classname="org.apache.tools.ant.launch.Launcher"
  234. classpath="${ant-launcher.jar}"
  235. fork="true"
  236. errorproperty="dita-ot.errorproperty"
  237. resultproperty="dita-ot.resultproperty"
  238. outputproperty="dita-ot.outputproperty"
  239. failonerror="false"
  240. maxmemory="1128m">
  241. <!--<arg value="-h"/> error="${dita-ot.output.dir.input}.error.log"-->
  242. <arg value="-Dargs.input=${dita-ot.args.input.input}"/>
  243. <arg value="-Dtranstype=pdf"/>
  244. <arg value="-Doutput.dir=${dita-ot.output.dir.input}"/>
  245. <arg value="-Dargs.rellinks=nofamily"/>
  246. <arg value="-Dclean.temp=no"/>
  247. <arg value="-Ddita.temp.dir=${dita-ot.temp.input}"/>
  248. <!--<arg value="-lib ${dita-ot.current-dita-ot.lib}"/>-->
  249. <arg value="-S"/>
  250. <arg value="-q"/>
  251. <classpath>
  252. <fileset dir="${dita-ot.current-dita-ot.lib}">
  253. <include name="**/*.jar"/>
  254. <include name="*.jar"/>
  255. <exclude name="**/commons-logging-1.0.4.jar"/>
  256. <exclude name=".commons-logging-1.0.4.jar"/>
  257. <exclude name="**/commons-logging-1.0.4.jar"/>
  258. </fileset>
  259. <fileset dir="${apache_fop.current.home}/lib">
  260. <include name="*.jar"/>
  261. </fileset>
  262. <fileset dir="${apache_fop.current.home}/build">
  263. <include name="fop.jar"/>
  264. <include name="fop-hyph.jar" />
  265. </fileset>
  266. </classpath>
  267. </java>
  268. <echoxml file="${dita-ot.temp.input.errorproperty.xml}">
  269. <dita-ot.temp.input.errorproperty.xml>
  270. ${dita-ot.errorproperty}
  271. </dita-ot.temp.input.errorproperty.xml>
  272. </echoxml>
  273. <echoxml file="${dita-ot.temp.input.resultproperty.xml}">
  274. <dita-ot.temp.input.resultproperty.xml>
  275. ${dita-ot.resultproperty}
  276. </dita-ot.temp.input.resultproperty.xml>
  277. </echoxml>
  278. <echoxml file="${dita-ot.temp.input.outputproperty.xml}">
  279. <dita-ot.temp.input.outputproperty.xml>
  280. ${dita-ot.outputproperty}
  281. </dita-ot.temp.input.outputproperty.xml>
  282. </echoxml>
  283. <!-- </try>-->
  284. <!--<catch>
  285. <property name="exception" refid="exception_ref" />
  286. <property name="message" value="#178XXX Error ${dita-ot.NOW} in trycatch block:${line.separator}${exception}" />
  287. <echo message="${message}" />
  288. <echo message="${message}" append="true" file="${dita-ot.output.error.touch}" />
  289. <antcall target="p5suis.p5suis:say_to_queue.PL">
  290. <param name="p5suis:say_text" value="Błąd tworzenia mapy p5:file ${dita-ot.args.input.input} - sprawdź otwierany plik."/>
  291. </antcall>
  292. <exec executable="open">
  293. <arg file="${dita-ot.temp.input.topic.fo}"/>
  294. </exec>
  295. <antcall target="finally">
  296. <param name="exception_param" value="${exception}"/>
  297. </antcall>
  298. <antcall target="finally_exception">
  299. <param name="exception_param" value="${exception}"/>
  300. </antcall>
  301. <fail message="${message}" />
  302. </catch>-->
  303. <!--<finally>-->
  304. <echo>Finally $exception = ${exception} Wykonano pdf z mapy p5:file ${dita-ot.args.input.input} to ${dita-ot.output.dir.input}
  305. $dita-ot.errorproperty = ${dita-ot.errorproperty}
  306. $dita-ot.resultproperty = ${dita-ot.resultproperty}
  307. </echo>
  308. <!--<antcall target="chm-pdf.finally">
  309. <param name="dita-ot.resultproperty.PARAM" value="${dita-ot.resultproperty}"/>
  310. </antcall>-->
  311. <!--<antcall target="chm-pdf.finally_exception">
  312. <param name="dita-ot.resultproperty.PARAM" value="${dita-ot.resultproperty}"/>
  313. </antcall>-->
  314. <property name="dita-ot.resultproperty.PARAM" value="${dita-ot.resultproperty}"/>
  315. <!--</finally>-->
  316. <!--</trycatch>-->
  317. </target>
  318. <!-- <pathelement path="${dita-ot.current-dita-ot.lib}"/>
  319. <pathelement path="${java.class.path}"/>
  320. <pathelement location="${dita-ot.current-dita-ot.dost.jar}" />
  321. <pathelement location="${dita-ot.current-dita-ot.commons-codec-1.4.jar}" />
  322. <pathelement location="${dita-ot.current-dita-ot.icu4j.jar}" />
  323. <pathelement location="${dita-ot.current-dita-ot.resolver.jar}" />
  324. -->
  325. </project>