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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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" 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" unless="dita-ot.output.complete.touch.if_exists" description="build PDF" > <!-- ant-contrib.init -->
  126. <tstamp>
  127. <format property="dita-ot.NOW" pattern="yyyy MMMM dd HH:mm:ss" locale="en"/>
  128. </tstamp>
  129. <echo>#20 will use settings
  130. $dita-ot.output.complete.touch = ${dita-ot.output.complete.touch}
  131. repo src $dita-ot.repository.pdf = ${dita-ot.repository.pdf}
  132. local dst $dita-ot.local.pdf ${dita-ot.local.pdf}
  133. $dita-ot.output.error.touch.if_exists = ${dita-ot.output.error.touch.if_exists} - ${dita-ot.output.error.touch}
  134. $dita-ot.output.preparing.touch.if_exists = ${dita-ot.output.preparing.touch.if_exists} - ${dita-ot.output.preparing.touch}
  135. $dita-ot.output.complete.touch.if_uptodate.cond = ${dita-ot.output.complete.touch.if_uptodate.cond}
  136. $dita-ot.output.complete.touch.if_exists = ${dita-ot.output.complete.touch.if_exists}
  137. $dita-ot.output.complete.touch.if_uptodate = ${dita-ot.output.complete.touch.if_uptodate}
  138. $dita-ot.temp.input = ${dita-ot.temp.input}
  139. $dita-ot.args.input.input = ${dita-ot.args.input.input}
  140. #### $dita-ot.output.dir.input = ${dita-ot.output.dir.input} ####
  141. $dita-ot.output.preparing.touch = ${dita-ot.output.preparing.touch}
  142. $dita-ot.output.error.touch = ${dita-ot.output.error.touch}
  143. $dita-ot.current-dita-ot.toolkit = ${dita-ot.current-dita-ot.toolkit}
  144. $dita-ot.current-dita-ot.lib = ${dita-ot.current-dita-ot.lib}
  145. ####
  146. </echo>
  147. <!-- The class which could not be loaded (org.dita.dost.module.GenMapAndTopicListModule)
  148. should be inside the dost.jar file. I don't have DITA-OT 1.6.3 installed,
  149. can you check please if [DITA-OT-1.6.3-install-dir]/lib/dost.jar includes this class?
  150. -->
  151. <!--<path id="dost.class.path">
  152. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.odt/lib/odt.jar"/>
  153. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.pdf2/lib/fo.jar"/>
  154. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.pdf2.axf/lib/axf.jar"/>
  155. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.pdf2.xep/lib/xep.jar"/>
  156. <pathelement location="${dita.dir}${file.separator}plugins/org.dita.wordrtf/lib/wordrtf.jar"/>
  157. <pathelement location="${dita.dir}/lib/dost.jar"/>
  158. <pathelement location="${dita.dir}/lib/dost-configuration.jar"/>
  159. <pathelement location="${dita-ot.current-dita-ot.resolver.jar}"/>
  160. <pathelement location="${dita-ot.current-dita-ot.commons-codec-1.4.jar}"/>
  161. <pathelement location="${dita-ot.current-dita-ot.dost.jar}"/>
  162. <pathelement location="${dita-ot.current-dita-ot.icu4j.jar}"/>
  163. <pathelement location="${dita-ot.current-dita-ot.resolver.jar}"/>
  164. </path>-->
  165. <!-- <classloader classpath="${dita-ot.current-dita-ot.dost.jar}" /> <!-\- -\->
  166. <classloader classpath="${dita-ot.current-dita-ot.commons-codec-1.4.jar}" />
  167. <classloader classpath="${dita-ot.current-dita-ot.icu4j.jar}" />
  168. <classloader classpath="${dita-ot.current-dita-ot.resolver.jar}" />-->
  169. <echo>#54 adding taskdef antcontrib to add childs
  170. ${dita-ot.current-dita-ot.lib}
  171. ${dita-ot.current-dita-ot.dost.jar}
  172. ${dita-ot.current-dita-ot.commons-codec-1.4.jar}
  173. ${dita-ot.current-dita-ot.icu4j.jar}
  174. ${dita-ot.current-dita-ot.resolver.jar}
  175. </echo>
  176. <!-- <available classname="org.apache.commons.logging.LogConfigurationException" property="org.apache.commons.logging.LogConfigurationException.present"/>
  177. <available classname="org.dita.dost.module.GenMapAndTopicListModule" property="org.dita.dost.module.GenMapAndTopicListModule.present"/>
  178. <available classname="net.sf.antcontrib.properties" property="net.sf.antcontrib.properties.present"/>
  179. <available classname="net.sf.antcontrib.logic.AntCallBack" property="net.sf.antcontrib.logic.AntCallBack.present"/>
  180. <available classname="org/apache/xerces/xni/grammars/XMLGrammarPool" property="org.apache.xerces.xni.grammars.XMLGrammarPool.present"/>
  181. -->
  182. <!--<echo>
  183. #71 dostepne klasy
  184. $dita-ot.current-dita-ot.lib = ${dita-ot.current-dita-ot.lib}
  185. $org.apache.commons.logging.LogConfigurationException.present = ${org.apache.commons.logging.LogConfigurationException.present}
  186. $org.dita.dost.module.GenMapAndTopicListModule.present = ${org.dita.dost.module.GenMapAndTopicListModule.present}
  187. $net.sf.antcontrib.properties ${net.sf.antcontrib.properties.present}
  188. $net.sf.antcontrib.logic.AntCallBack.present = ${net.sf.antcontrib.logic.AntCallBack.present}
  189. dost.jar = ${dost.jar}
  190. org/apache/xerces/xni/grammars/XMLGrammarPool = ${org.apache.xerces.xni.grammars.XMLGrammarPool.present}
  191. </echo>-->
  192. <!-- jar="${ant-launcher.jar}" -->
  193. <taskdef resource="net/sf/antcontrib/antlib.xml"/>
  194. <!--
  195. <trycatch reference="exception_ref">
  196. <try>-->
  197. <echo>#113 Start Building Delivery</echo>
  198. <antcall target="p5suis.p5suis:say_to_queue.PL">
  199. <param name="p5suis:say_text" value="Tworzę pdf ${dita-ot.args.input.ditamap.title.info} z mapy p5:file ${dita-ot.args.input.input}"/>
  200. </antcall>
  201. <java dir="${dita-ot.current-dita-ot.toolkit}"
  202. classname="org.apache.tools.ant.launch.Launcher"
  203. classpath="${ant-launcher.jar}"
  204. fork="true"
  205. errorproperty="dita-ot.errorproperty"
  206. resultproperty="dita-ot.resultproperty"
  207. outputproperty="dita-ot.outputproperty"
  208. failonerror="true"
  209. maxmemory="1128m">
  210. <!--<arg value="-h"/>-->
  211. <arg value="-Dargs.input=${dita-ot.args.input.input}"/>
  212. <arg value="-Dtranstype=pdf"/>
  213. <arg value="-Doutput.dir=${dita-ot.output.dir.input}"/>
  214. <arg value="-Dargs.rellinks=nofamily"/>
  215. <arg value="-Dclean.temp=no"/>
  216. <arg value="-Ddita.temp.dir=${dita-ot.temp.input}"/>
  217. <!--<arg value="-lib ${dita-ot.current-dita-ot.lib}"/>-->
  218. <arg value="-S"/>
  219. <arg value="-q"/>
  220. <classpath>
  221. <fileset dir="${dita-ot.current-dita-ot.lib}">
  222. <include name="**/*.jar"/>
  223. <include name="*.jar"/>
  224. <exclude name="**/commons-logging-1.0.4.jar"/>
  225. <exclude name=".commons-logging-1.0.4.jar"/>
  226. <exclude name="**/commons-logging-1.0.4.jar"/>
  227. </fileset>
  228. </classpath>
  229. </java>
  230. <echoxml file="${dita-ot.temp.input.errorproperty.xml}">
  231. <dita-ot.temp.input.errorproperty.xml>
  232. ${dita-ot.errorproperty}
  233. </dita-ot.temp.input.errorproperty.xml>
  234. </echoxml>
  235. <echoxml file="${dita-ot.temp.input.resultproperty.xml}">
  236. <dita-ot.temp.input.resultproperty.xml>
  237. ${dita-ot.resultproperty}
  238. </dita-ot.temp.input.resultproperty.xml>
  239. </echoxml>
  240. <echoxml file="${dita-ot.temp.input.outputproperty.xml}">
  241. <dita-ot.temp.input.outputproperty.xml>
  242. ${dita-ot.outputproperty}
  243. </dita-ot.temp.input.outputproperty.xml>
  244. </echoxml>
  245. <!-- </try>-->
  246. <!--<catch>
  247. <property name="exception" refid="exception_ref" />
  248. <property name="message" value="#178XXX Error ${dita-ot.NOW} in trycatch block:${line.separator}${exception}" />
  249. <echo message="${message}" />
  250. <echo message="${message}" append="true" file="${dita-ot.output.error.touch}" />
  251. <antcall target="p5suis.p5suis:say_to_queue.PL">
  252. <param name="p5suis:say_text" value="Błąd tworzenia mapy p5:file ${dita-ot.args.input.input} - sprawdź otwierany plik."/>
  253. </antcall>
  254. <exec executable="open">
  255. <arg file="${dita-ot.temp.input.topic.fo}"/>
  256. </exec>
  257. <antcall target="finally">
  258. <param name="exception_param" value="${exception}"/>
  259. </antcall>
  260. <antcall target="finally_exception">
  261. <param name="exception_param" value="${exception}"/>
  262. </antcall>
  263. <fail message="${message}" />
  264. </catch>-->
  265. <!--<finally>-->
  266. <echo>Finally $exception = ${exception} Wykonano pdf z mapy p5:file ${dita-ot.args.input.input} to ${dita-ot.output.dir.input}
  267. $dita-ot.errorproperty = ${dita-ot.errorproperty}
  268. $dita-ot.resultproperty = ${dita-ot.resultproperty}
  269. </echo>
  270. <antcall target="chm-pdf.finally">
  271. <param name="dita-ot.resultproperty.PARAM" value="${dita-ot.resultproperty}"/>
  272. </antcall>
  273. <antcall target="chm-pdf.finally_exception">
  274. <param name="dita-ot.resultproperty.PARAM" value="${dita-ot.resultproperty}"/>
  275. </antcall>
  276. <!--</finally>-->
  277. <!--</trycatch>-->
  278. </target>
  279. <!-- <pathelement path="${dita-ot.current-dita-ot.lib}"/>
  280. <pathelement path="${java.class.path}"/>
  281. <pathelement location="${dita-ot.current-dita-ot.dost.jar}" />
  282. <pathelement location="${dita-ot.current-dita-ot.commons-codec-1.4.jar}" />
  283. <pathelement location="${dita-ot.current-dita-ot.icu4j.jar}" />
  284. <pathelement location="${dita-ot.current-dita-ot.resolver.jar}" />
  285. -->
  286. </project>