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

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