build.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project basedir="." name="PROCES_TO_DITA" default="PROCES_TO_DITA_build">
  3. <!-- Przykładowe wyzwolenie z bash :
  4. cat input.xml | /Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/ant -buildfile ild__IN7_DZIENNIK_KORESP.xml
  5. na output mamy pdf'a
  6. -->
  7. <property name="INPUT" value="main.dita"/> <!-- Test_z_getfeature_do_parse.xml todo cos co otrzymamy z API do parsowania -->
  8. <!--<property name="main.dita" value="main.dita"/>-->
  9. <property name="parse_dita_templ.xsl" value="parse_dita_templ.xsl"/> <!-- do wykorzystania do przeparsowania pliku main.dita-->
  10. <property name="PROCES_INCLUDE.xsl" value="PROCES_INCLUDE.xsl" /> <!-- parser main.dita - potem pewnie przeparsowanego pliku -->
  11. <!--<tempfile property="tmp.xml" destdir="temp" deleteonexit="yes"/>-->
  12. <!--<tempfile property="Test_z_getfeature_do_parse__noxml.xml" destdir="temp" deleteonexit="yes"/>-->
  13. <!--<tempfile property="main__noxml.dita" destdir="temp" deleteonexit="yes"/>-->
  14. <!--<tempfile property="Test_z_getfeature_do_parse__noxml.xml" destdir="temp" deleteonexit="yes"/>-->
  15. <!--<tempfile property="main__noxml.dita" destdir="temp" deleteonexit="yes"/>-->
  16. <tempfile property="out.dita" deleteonexit="no" /> <!-- do wygenerowania dita do zrobienia z niego PDF -->
  17. <!--<tempfile destdir="out.dita" deleteonexit="yes"/>-->
  18. <!--<delete file="tmp.xml"/>
  19. <delete file="Test_z_getfeature_do_parse__noxml.xml"/>
  20. <delete file="main__noxml.dita"/>-->
  21. <!--<if>
  22. <available file="${INPUT}" type="file" />
  23. </if>-->
  24. <target name="check" >
  25. <echo message="testuje check"/>
  26. <condition property="test_if_INPUTxml" taskname="PROCES_TO_DITA_build" value="AVIABLE">
  27. <available file="${INPUT}" filepath="." />
  28. </condition>
  29. </target>
  30. <target name="make_inputXML_from_stdin" unless="test_if_INPUTxml">
  31. <echo message="make_inputXML_from_stdin is not aviable appending"/>
  32. <input addproperty="INPUT_from_stdin"/>
  33. <echo message="${INPUT_from_stdin}" file="${INPUT}"/>
  34. <!--<echo file="${test_if_INPUTxml}" message=""/>-->
  35. </target>
  36. <target name="check-info" if="test_if_INPUTxml">
  37. <echo message="Using default XML object on input from file ${INPUT} . "/>
  38. </target>
  39. <target name="PROCES_TO_DITA_build" depends="check,check-info,make_inputXML_from_stdin">
  40. <echo message="PROCES_TO_DITA_build to ${test_if_INPUTxml}"/>
  41. <!-- przyklad z uzywaniem saxona ktorego wczesniej trzeba pobrac z port install saxon -->
  42. <!--<xslt style="copy-no-xml.xsl" in="${INPUT}" out="${Test_z_getfeature_do_parse__noxml.xml}"> <!-\- {Test_z_getfeature_do_parse__noxml.xml"-\->
  43. <factory name="net.sf.saxon.TransformerFactoryImpl">
  44. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  45. </factory>
  46. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  47. </xslt>-->
  48. <!--<xslt style="copy-no-xml.xsl" in="main.dita" out="${main__noxml.dita}"/>-->
  49. <!--<concat destfile="${tmp.xml}" append="true" encoding="UTF-8" >
  50. <string>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  51. &lt;root&gt;</string>
  52. <file file="${Test_z_getfeature_do_parse__noxml.xml}" />
  53. <file file="${main__noxml.dita}"/>
  54. <string>&lt;/root&gt;</string>
  55. </concat>-->
  56. <!-- parsuje main.dita aby wiedziec, jaki proces jest zalaczany do danego zaglebienia aby wygenerowac docelowy plik dita z zaglebieniami -->
  57. <xslt basedir="./" style="${parse_dita_templ.xsl}" in="${INPUT}" destdir="./" out="out.dita" >
  58. <factory name="net.sf.saxon.TransformerFactoryImpl">
  59. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  60. <attribute name="http://saxon.sf.net/feature/initialMode" value="DITA_PARSE_templ"/>
  61. <!--<attribute name="http://saxon.sf.net/feature/initialTemplate" value="asd"/>-->
  62. </factory>
  63. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  64. <!--<param name="dita_task_template_file_param" expression="main.dita"/>-->
  65. </xslt>
  66. <!-- tymczasowe rem dla zrobienia akcji wyzej -->
  67. <!--<xslt basedir="./" style="${PROCES_INCLUDE.xsl}" in="${INPUT}" destdir="./" out="out.dita" >
  68. <factory name="net.sf.saxon.TransformerFactoryImpl">
  69. <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
  70. <attribute name="http://saxon.sf.net/feature/initialMode" value="PROCES_INCLUDE"/>
  71. <!-\-<attribute name="http://saxon.sf.net/feature/initialTemplate" value="asd"/>-\->
  72. </factory>
  73. <classpath location="/opt/local/share/java/saxon9he.jar"/>
  74. <!-\-<param name="dita_task_template_file_param" expression="main.dita"/>-\->
  75. </xslt>-->
  76. <!--<property name="dita.dir" location="/Library/Server/Web/Data/Sites/Default/SE/stuff/dita-ot-2.3.3/bin/dita"/>-->
  77. <!--<exec executable="${dita.dir}" dir=".">
  78. <arg value="-i"/>
  79. <arg value="${out_task.dita}" />
  80. <arg value="-f" />
  81. <arg value="pdf"/>
  82. <arg value="-o"/>
  83. <arg value="out"/>
  84. </exec>-->
  85. <!--<exec executable="bash" dir="." outputproperty="out_task_file">
  86. <arg value="-c"/>
  87. <arg value="echo ${out_task.dita} |sed 's/^.*\///'"/>
  88. </exec>-->
  89. <!--<propertyregex property="out_file" input="${out_task.dita}" regexp="$.*/(.*)" select="\1."/>-->
  90. <!--<loadfile property="result" srcFile="out/${out_task_file}.pdf"/>-->
  91. <!--<echo message="input was : ${input}"/>-->
  92. <!--<echo message="${result}"/>-->
  93. <!--<propertyregex
  94. name="test"
  95. property="current.target.dir"
  96. input="com.element.subelement"
  97. regexp="\."
  98. replace="/"
  99. global="true" />-->
  100. </target>
  101. </project>