You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?xml version="1.0"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <project default="compile" basedir=".">
  18. <property name="Name" value="Apache FOP - Embedding Examples"/>
  19. <property name="name" value="embedding"/>
  20. <!-- compiler switches -->
  21. <property name="debug" value="on"/>
  22. <property name="optimize" value="off"/>
  23. <property name="deprecation" value="on"/>
  24. <!-- directories -->
  25. <property name="src.dir" value="./java"/>
  26. <property name="fop.lib.dir" value="../../lib"/>
  27. <property name="lib.dir" value="./lib"/>
  28. <property name="build.dir" value="./build"/>
  29. <property name="build.src" value="./build/src"/>
  30. <property name="build.dest" value="./build/classes"/>
  31. <!-- stuff -->
  32. <path id="project.class.path">
  33. <fileset dir="${fop.lib.dir}">
  34. <include name="batik*.jar"/>
  35. <include name="xml-apis*.jar"/>
  36. <include name="xerces*.jar"/>
  37. <include name="xalan*.jar"/>
  38. <include name="serializer*.jar"/>
  39. <include name="commons-io*.jar"/>
  40. <include name="commons-logging*.jar"/>
  41. <include name="xmlgraphics-commons*.jar"/>
  42. </fileset>
  43. <fileset dir="${fop.lib.dir}/../build">
  44. <include name="fop.jar"/>
  45. </fileset>
  46. </path>
  47. <!-- =================================================================== -->
  48. <!-- Initialization target -->
  49. <!-- =================================================================== -->
  50. <target name="init">
  51. <tstamp/>
  52. <property name="year" value="2002-2004,2006"/>
  53. <echo message="------------------- ${Name} [${year}] ----------------"/>
  54. </target>
  55. <!-- =================================================================== -->
  56. <!-- Prepares the build directory -->
  57. <!-- =================================================================== -->
  58. <target name="prepare" depends="init">
  59. <!-- create directories -->
  60. <echo message="Preparing the build directories"/>
  61. <mkdir dir="${build.dir}"/>
  62. <mkdir dir="${build.dest}"/>
  63. </target>
  64. <!-- =================================================================== -->
  65. <!-- Compiles the source directory -->
  66. <!-- =================================================================== -->
  67. <target name="compile" depends="prepare" description="Compiles the examples">
  68. <echo message="Compiling the sources"/>
  69. <javac srcdir="${src.dir}" destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}" includeAntRuntime="true">
  70. <classpath refid="project.class.path"/>
  71. </javac>
  72. </target>
  73. <!-- =================================================================== -->
  74. <!-- Runs the various examples -->
  75. <!-- =================================================================== -->
  76. <target name="example1" depends="compile" description="Runs the FO to PDF example">
  77. <echo message="Running the FO to PDF example"/>
  78. <java classname="${name}.ExampleFO2PDF" fork="yes">
  79. <classpath>
  80. <path refid="project.class.path"/>
  81. <pathelement location="${build.dest}"/>
  82. </classpath>
  83. </java>
  84. </target>
  85. <target name="example2" depends="compile" description="Runs the FO to PDF example using a SAXParser">
  86. <echo message="Running the FO to PDF example using a SAXParser"/>
  87. <java classname="${name}.ExampleFO2PDFUsingSAXParser" fork="yes">
  88. <classpath>
  89. <path refid="project.class.path"/>
  90. <pathelement location="${build.dest}"/>
  91. </classpath>
  92. </java>
  93. </target>
  94. <target name="example3" depends="compile" description="Runs the XML to FO example">
  95. <echo message="Running the XML to FO example"/>
  96. <java classname="${name}.ExampleXML2FO" fork="yes">
  97. <classpath>
  98. <path refid="project.class.path"/>
  99. <pathelement location="${build.dest}"/>
  100. </classpath>
  101. </java>
  102. </target>
  103. <target name="example4" depends="compile" description="Runs the XML to PDF example">
  104. <echo message="Running the XML to PDF example"/>
  105. <java classname="${name}.ExampleXML2PDF" fork="yes">
  106. <classpath>
  107. <path refid="project.class.path"/>
  108. <pathelement location="${build.dest}"/>
  109. </classpath>
  110. </java>
  111. </target>
  112. <target name="example5" depends="compile" description="Runs the Object to XML example">
  113. <echo message="Running the Object to XML example"/>
  114. <java classname="${name}.ExampleObj2XML" fork="yes">
  115. <classpath>
  116. <path refid="project.class.path"/>
  117. <pathelement location="${build.dest}"/>
  118. </classpath>
  119. </java>
  120. </target>
  121. <target name="example6" depends="compile" description="Runs the Object to PDF example">
  122. <echo message="Running the Object to PDF example"/>
  123. <java classname="${name}.ExampleObj2PDF" fork="yes">
  124. <classpath>
  125. <path refid="project.class.path"/>
  126. <pathelement location="${build.dest}"/>
  127. </classpath>
  128. </java>
  129. </target>
  130. <target name="example7" depends="compile" description="Runs the DOM to PDF example">
  131. <echo message="Running the DOM to PDF example"/>
  132. <java classname="${name}.ExampleDOM2PDF" fork="yes">
  133. <classpath>
  134. <path refid="project.class.path"/>
  135. <pathelement location="${build.dest}"/>
  136. </classpath>
  137. </java>
  138. </target>
  139. <target name="example8" depends="compile" description="Runs the SVG to PDF example">
  140. <echo message="Running the SVG to PDF example"/>
  141. <java classname="${name}.ExampleSVG2PDF" fork="yes">
  142. <classpath>
  143. <path refid="project.class.path"/>
  144. <pathelement location="${build.dest}"/>
  145. </classpath>
  146. <jvmarg value="-Xmx1024m"/>
  147. </java>
  148. </target>
  149. <target name="run" depends="example1,example2,example3,example4,example5,example5,example7,example8" description="Runs examples"/>
  150. <!-- =================================================================== -->
  151. <!-- Clean targets -->
  152. <!-- =================================================================== -->
  153. <target name="clean" depends="init" description="Cleans the build directory">
  154. <delete dir="${build.dir}"/>
  155. </target>
  156. </project>