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 58KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. <?xml version="1.0"?>
  2. <!--
  3. Copyright 1999-2006 The Apache Software Foundation
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!-- ===========================================================================
  15. * ================== *
  16. | FOP build system |
  17. * ================== *
  18. Building instructions
  19. =====================
  20. First, install Ant (http://ant.apache.org). Check that ant or ant.bat
  21. is in your search path and that JAVA_HOME and ANT_HOME are properly set.
  22. Next make sure your current working directory is where this very file is
  23. located. Then type
  24. ant
  25. If everything is right and all the required packages are visible, this action
  26. will generate a file called "fop.jar" in the "./build" directory.
  27. If you experience any problems with the build please visit the FOP website for
  28. more information: http://xmlgraphics.apache.org/fop
  29. Build targets
  30. =============
  31. The build system is not only responsible for compiling Fop into a jar file,
  32. but is also responsible for creating the javadocs, distributions, examples
  33. and a miscellaneous stuff. In fact, the file you have here is _exactly_ what
  34. is used by fop maintainers to take care of nearly everything in the Fop
  35. project, no less and no more.
  36. Call the Ant (see above) with the parameter "-projecthelp" to get a
  37. list of possible build targets.
  38. ============================================================================ -->
  39. <project default="all" basedir="." name="fop">
  40. <!-- See build.properties and build-local.properties for overriding build settings. -->
  41. <!-- build-local.properties is not stored in SVN and overrides values from build.properties -->
  42. <property file="${basedir}/build-local.properties"/>
  43. <property file="${basedir}/build.properties"/>
  44. <property environment="env"/>
  45. <property name="optional.lib.dir" value="${basedir}/lib"/>
  46. <fileset dir="${basedir}" id="dist.bin">
  47. <include name="conf/**"/>
  48. <include name="examples/**"/>
  49. <include name="LICENSE"/>
  50. <include name="NOTICE"/>
  51. <include name="README"/>
  52. <include name="KEYS"/>
  53. <include name="status.xml"/>
  54. <include name="fop.bat"/>
  55. <include name="fop"/>
  56. </fileset>
  57. <fileset dir="${basedir}" id="dist.bin.lib">
  58. <patternset id="dist.lib">
  59. <include name="lib/avalon-framework*"/>
  60. <include name="lib/xmlgraphics-commons*"/>
  61. <include name="lib/batik*"/>
  62. <include name="lib/commons-io*"/>
  63. <include name="lib/commons-logging*"/>
  64. <include name="lib/README*"/>
  65. <include name="lib/serializer*"/>
  66. <include name="lib/xalan*"/>
  67. <include name="lib/xerces*"/>
  68. <include name="lib/xml-apis*"/>
  69. </patternset>
  70. </fileset>
  71. <fileset dir="${basedir}" id="dist.src">
  72. <include name="src/**"/>
  73. <include name="conf/**"/>
  74. <include name="hyph/hyphenation.dtd"/>
  75. <include name="hyph/readme"/>
  76. <patternset refid="dist.lib"/>
  77. <include name="lib/servlet*"/>
  78. <include name="test/**"/>
  79. <include name="examples/**"/>
  80. <include name="LICENSE"/>
  81. <include name="NOTICE"/>
  82. <include name="README"/>
  83. <include name="KEYS"/>
  84. <include name="status.xml"/>
  85. <include name="build.*"/>
  86. <include name="fop.bat"/>
  87. <include name="fop"/>
  88. </fileset>
  89. <path id="libs-build-classpath">
  90. <fileset dir="${basedir}/lib">
  91. <include name="*.jar"/>
  92. </fileset>
  93. <fileset dir="${optional.lib.dir}">
  94. <include name="*.jar"/>
  95. </fileset>
  96. </path>
  97. <path id="libs-run-classpath">
  98. <fileset dir="${basedir}/lib">
  99. <include name="*.jar"/>
  100. </fileset>
  101. <fileset dir="${optional.lib.dir}">
  102. <include name="*.jar"/>
  103. </fileset>
  104. <fileset dir="${basedir}/build">
  105. <include name="fop.jar"/>
  106. <include name="fop-hyph.jar" />
  107. </fileset>
  108. </path>
  109. <patternset id="exclude-jimi">
  110. <exclude name="org/apache/fop/image/JimiImage.java" unless="jimi.present"/>
  111. </patternset>
  112. <patternset id="exclude-jai">
  113. <exclude name="org/apache/fop/image/JAIImage.java" unless="jai.present"/>
  114. </patternset>
  115. <patternset id="exclude-jce-dependencies">
  116. <exclude name="org/apache/fop/pdf/PDFEncryptionJCE.java" unless="jce.present"/>
  117. </patternset>
  118. <property name="Name" value="Apache FOP"/>
  119. <property name="name" value="fop"/>
  120. <property name="NAME" value="FOP"/>
  121. <property name="version" value="0.92beta"/>
  122. <property name="year" value="1999-2006"/>
  123. <property name="javac.debug" value="on"/>
  124. <property name="javac.optimize" value="off"/>
  125. <property name="javac.deprecation" value="on"/>
  126. <property name="javac.source" value="1.3"/>
  127. <property name="javac.target" value="1.3"/>
  128. <property name="javac.fork" value="no"/>
  129. <property name="junit.fork" value="on"/>
  130. <property name="javadoc.packages" value="org.apache.fop.*"/>
  131. <property name="src.dir" value="${basedir}/src"/>
  132. <property name="src.codegen.dir" value="${src.dir}/codegen"/>
  133. <property name="src.java.dir" value="${src.dir}/java"/>
  134. <property name="src.sandbox.dir" value="${src.dir}/sandbox"/>
  135. <property name="src.viewer.resources.dir" value="${src.java.dir}/org/apache/fop/render/awt/viewer/resources"/>
  136. <property name="src.viewer.images.dir" value="${src.java.dir}/org/apache/fop/render/awt/viewer/images"/>
  137. <property name="xdocs.dir" value="${src.dir}/documentation/content/xdocs"/>
  138. <property name="fo.examples.dir" value="${basedir}/examples/fo/basic"/>
  139. <property name="lib.dir" value="${basedir}/lib"/>
  140. <property name="user.hyph.dir" value="${basedir}/hyph"/>
  141. <property name="build.dir" value="${basedir}/build"/>
  142. <property name="build.gensrc.dir" value="${build.dir}/gensrc"/>
  143. <property name="build.classes.dir" value="${build.dir}/classes"/>
  144. <property name="build.sandbox-classes.dir" value="${build.dir}/sandbox-classes"/>
  145. <property name="build.javadocs.dir" value="${build.dir}/javadocs"/>
  146. <property name="build.examples.dir" value="${build.dir}/examples"/>
  147. <property name="build.viewer.resources.dir" value="${build.classes.dir}/org/apache/fop/render/awt/viewer/resources"/>
  148. <property name="build.viewer.images.dir" value="${build.classes.dir}/org/apache/fop/render/awt/viewer/images"/>
  149. <property name="build.property.examples.mime.type" value="application/pdf"/>
  150. <!--property name="layoutengine.disabled" value="test/layoutengine/disabled-testcases.txt"/-->
  151. <!--property name="fotree.disabled" value="test/fotree/disabled-testcases.txt"/-->
  152. <property name="layoutengine.disabled" value="test/layoutengine/disabled-testcases.xml"/>
  153. <property name="fotree.disabled" value="test/fotree/disabled-testcases.xml"/>
  154. <property name="dist.bin.dir" value="${basedir}/dist-bin"/>
  155. <property name="dist.src.dir" value="${basedir}/dist-src"/>
  156. <property name="dist.bin.result.dir" value="${dist.bin.dir}/${name}-${version}"/>
  157. <property name="dist.src.result.dir" value="${dist.src.dir}/${name}-${version}"/>
  158. <property name="samedir" value="${basedir}"/>
  159. <!-- Importing Apache Forrest for building the docs -->
  160. <!--
  161. <property environment="env"/>
  162. <property name="forrest.home" value="${env.FORREST_HOME}"/>
  163. <import file="${env.FORREST_HOME}/main/forrest.build.xml" optional="true"/>
  164. -->
  165. <!-- =================================================================== -->
  166. <!-- Initialization target -->
  167. <!-- =================================================================== -->
  168. <target name="init" depends="init-avail, init-filters-jdk14, init-filters-jdk13">
  169. </target>
  170. <target name="init-avail">
  171. <echo message="------------------- ${Name} ${version} [${year}] ----------------"/>
  172. <echo message="See build.properties and build-local.properties for additional build settings"/>
  173. <echo message="${ant.version}"/>
  174. <echo message="VM: ${java.vm.version}, ${java.vm.vendor}"/>
  175. <echo message="JAVA_HOME: ${env.JAVA_HOME}"/>
  176. <available property="jimi.present" classname="com.sun.jimi.core.Jimi"
  177. classpathref="libs-build-classpath"/>
  178. <condition property="jimi.message" value="Jimi Support PRESENT">
  179. <equals arg1="${jimi.present}" arg2="true"/>
  180. </condition>
  181. <condition property="jimi.message" value="Jimi Support NOT Present">
  182. <not>
  183. <equals arg1="${jimi.present}" arg2="true"/>
  184. </not>
  185. </condition>
  186. <echo message="${jimi.message}"/>
  187. <available property="jai.present" classname="javax.media.jai.JAI"
  188. classpathref="libs-build-classpath"/>
  189. <condition property="jai.message" value="JAI Support PRESENT">
  190. <equals arg1="${jai.present}" arg2="true"/>
  191. </condition>
  192. <condition property="jai.message" value="JAI Support NOT Present">
  193. <not>
  194. <equals arg1="${jai.present}" arg2="true"/>
  195. </not>
  196. </condition>
  197. <echo message="${jai.message}"/>
  198. <available property="jce.present" classname="javax.crypto.Cipher"
  199. classpathref="libs-build-classpath"/>
  200. <condition property="jce.message" value="JCE Support PRESENT">
  201. <equals arg1="${jce.present}" arg2="true"/>
  202. </condition>
  203. <condition property="jce.message" value="JCE Support NOT Present">
  204. <not>
  205. <equals arg1="${jce.present}" arg2="true"/>
  206. </not>
  207. </condition>
  208. <echo message="${jce.message}"/>
  209. <available property="jdk14.present" classname="java.lang.CharSequence"/>
  210. <available property="junit.present" classname="junit.framework.TestCase"
  211. classpathref="libs-build-classpath"/>
  212. <condition property="junit.message" value="JUnit Support PRESENT">
  213. <equals arg1="${junit.present}" arg2="true"/>
  214. </condition>
  215. <condition property="junit.message" value="JUnit Support NOT Present - Committers are required to have JUnit working">
  216. <not>
  217. <equals arg1="${junit.present}" arg2="true"/>
  218. </not>
  219. </condition>
  220. <echo message="${junit.message}"/>
  221. <condition property="xmlunit.present">
  222. <and>
  223. <available classname="org.custommonkey.xmlunit.XMLTestCase" classpathref="libs-build-classpath"/>
  224. <isset property="junit.present"/>
  225. </and>
  226. </condition>
  227. <condition property="xmlunit.message" value="XMLUnit Support PRESENT">
  228. <equals arg1="${xmlunit.present}" arg2="true"/>
  229. </condition>
  230. <condition property="xmlunit.message" value="XMLUnit Support NOT Present - you can get it from http://xmlunit.sourceforge.net">
  231. <not>
  232. <equals arg1="${xmlunit.present}" arg2="true"/>
  233. </not>
  234. </condition>
  235. <echo message="${xmlunit.message}"/>
  236. </target>
  237. <target name="init-filters-jdk13" depends="init-avail" unless="jdk14.present">
  238. <echo message="Use GraphicsConfiguration adapter for JDK 1.3 or earlier."/>
  239. <path id="graphics-configuration-adapter">
  240. <pathelement location="src/java-1.3"/>
  241. </path>
  242. </target>
  243. <target name="init-filters-jdk14" depends="init-avail" if="jdk14.present">
  244. <echo message="Use GraphicsConfiguration adapter for JDK 1.4."/>
  245. <path id="graphics-configuration-adapter">
  246. <pathelement location="src/java-1.4"/>
  247. </path>
  248. </target>
  249. <!-- =================================================================== -->
  250. <!-- Help on usage -->
  251. <!-- =================================================================== -->
  252. <target name="usage">
  253. <echo message="Use the -projecthelp option instead"/>
  254. </target>
  255. <!-- =================================================================== -->
  256. <!-- Generate the source code -->
  257. <!-- =================================================================== -->
  258. <target name="codegen" depends="init" description="Generates the java files from the xml resources">
  259. <echo message="Generating the java files from xml resources"/>
  260. <mkdir dir="${build.gensrc.dir}"/>
  261. <mkdir dir="${build.gensrc.dir}/org/apache/fop/fonts/base14"/>
  262. <style in="${src.codegen.dir}/encodings.xml"
  263. style="${src.codegen.dir}/code-point-mapping.xsl"
  264. out="${build.gensrc.dir}/org/apache/fop/fonts/CodePointMapping.java"/>
  265. <!-- Task unrolled because of a bug in Xalan included in some
  266. JDK 1.4 releases
  267. <style basedir="src/codegen" includes="Helvetica*.xml,Times*.xml,Courier*.xml"
  268. style="${src.codegen.dir}/font-file.xsl"
  269. destdir="${build.gensrc.dir}/org/apache/fop/fonts/base14" extension=".java">
  270. <param name="encoding" expression="WinAnsiEncoding"/>
  271. </style>
  272. -->
  273. <style in="${src.codegen.dir}/Courier.xml" style="${src.codegen.dir}/font-file.xsl"
  274. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/Courier.java">
  275. <param name="encoding" expression="WinAnsiEncoding"/>
  276. </style>
  277. <style in="${src.codegen.dir}/CourierOblique.xml" style="${src.codegen.dir}/font-file.xsl"
  278. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/CourierOblique.java">
  279. <param name="encoding" expression="WinAnsiEncoding"/>
  280. </style>
  281. <style in="${src.codegen.dir}/CourierBold.xml" style="${src.codegen.dir}/font-file.xsl"
  282. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/CourierBold.java">
  283. <param name="encoding" expression="WinAnsiEncoding"/>
  284. </style>
  285. <style in="${src.codegen.dir}/CourierBoldOblique.xml" style="${src.codegen.dir}/font-file.xsl"
  286. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/CourierBoldOblique.java">
  287. <param name="encoding" expression="WinAnsiEncoding"/>
  288. </style>
  289. <style in="${src.codegen.dir}/Helvetica.xml" style="${src.codegen.dir}/font-file.xsl"
  290. destdir="${build.gensrc.dir}/org/apache/fop/fonts/base14"
  291. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/Helvetica.java">
  292. <param name="encoding" expression="WinAnsiEncoding"/>
  293. </style>
  294. <style in="${src.codegen.dir}/HelveticaBold.xml" style="${src.codegen.dir}/font-file.xsl"
  295. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/HelveticaBold.java">
  296. <param name="encoding" expression="WinAnsiEncoding"/>
  297. </style>
  298. <style in="${src.codegen.dir}/HelveticaOblique.xml" style="${src.codegen.dir}/font-file.xsl"
  299. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/HelveticaOblique.java">
  300. <param name="encoding" expression="WinAnsiEncoding"/>
  301. </style>
  302. <style in="${src.codegen.dir}/HelveticaBoldOblique.xml" style="${src.codegen.dir}/font-file.xsl"
  303. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/HelveticaBoldOblique.java">
  304. <param name="encoding" expression="WinAnsiEncoding"/>
  305. </style>
  306. <style in="${src.codegen.dir}/TimesRoman.xml" style="${src.codegen.dir}/font-file.xsl"
  307. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/TimesRoman.java">
  308. <param name="encoding" expression="WinAnsiEncoding"/>
  309. </style>
  310. <style in="${src.codegen.dir}/TimesItalic.xml" style="${src.codegen.dir}/font-file.xsl"
  311. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/TimesItalic.java">
  312. <param name="encoding" expression="WinAnsiEncoding"/>
  313. </style>
  314. <style in="${src.codegen.dir}/TimesBold.xml" style="${src.codegen.dir}/font-file.xsl"
  315. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/TimesBold.java">
  316. <param name="encoding" expression="WinAnsiEncoding"/>
  317. </style>
  318. <style in="${src.codegen.dir}/TimesBoldItalic.xml" style="${src.codegen.dir}/font-file.xsl"
  319. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/TimesBoldItalic.java">
  320. <param name="encoding" expression="WinAnsiEncoding"/>
  321. </style>
  322. <style in="${src.codegen.dir}/Symbol.xml" style="${src.codegen.dir}/font-file.xsl"
  323. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/Symbol.java"/>
  324. <style in="${src.codegen.dir}/ZapfDingbats.xml" style="${src.codegen.dir}/font-file.xsl"
  325. out="${build.gensrc.dir}/org/apache/fop/fonts/base14/ZapfDingbats.java"/>
  326. </target>
  327. <!-- =================================================================== -->
  328. <!-- Compiles the source directory -->
  329. <!-- =================================================================== -->
  330. <target name="compile-java" depends="init, codegen" description="Compiles the source code">
  331. <!-- create directories -->
  332. <mkdir dir="${build.classes.dir}"/>
  333. <javac destdir="${build.classes.dir}" fork="${javac.fork}" debug="${javac.debug}"
  334. deprecation="${javac.deprecation}" optimize="${javac.optimize}"
  335. source="${javac.source}" target="${javac.target}">
  336. <src path="${build.gensrc.dir}"/>
  337. <src path="${src.java.dir}"/>
  338. <src refid="graphics-configuration-adapter"/>
  339. <patternset includes="**/*.java"/>
  340. <!--patternset includes="org/apache/fop/svg/GraphicsConfiguration.java"/-->
  341. <patternset refid="exclude-jce-dependencies"/>
  342. <patternset refid="exclude-jai"/>
  343. <patternset refid="exclude-jimi"/>
  344. <classpath refid="libs-build-classpath"/>
  345. </javac>
  346. <copy todir="${build.classes.dir}">
  347. <fileset dir="${src.java.dir}">
  348. <include name="META-INF/**"/>
  349. <include name="**/*.icm"/>
  350. <include name="**/*.LICENSE.txt"/>
  351. </fileset>
  352. </copy>
  353. <mkdir dir="${build.viewer.resources.dir}"/>
  354. <copy todir="${build.viewer.resources.dir}">
  355. <fileset dir="${src.viewer.resources.dir}"/>
  356. </copy>
  357. <mkdir dir="${build.viewer.images.dir}"/>
  358. <copy todir="${build.viewer.images.dir}">
  359. <fileset dir="${src.viewer.images.dir}"/>
  360. </copy>
  361. <mkdir dir="${build.sandbox-classes.dir}"/>
  362. <javac destdir="${build.sandbox-classes.dir}" fork="${javac.fork}" debug="${javac.debug}"
  363. deprecation="${javac.deprecation}" optimize="${javac.optimize}"
  364. source="${javac.source}" target="${javac.target}">
  365. <src path="${src.sandbox.dir}"/>
  366. <patternset includes="**/*.java"/>
  367. <classpath>
  368. <path refid="libs-build-classpath"/>
  369. <pathelement location="${build.classes.dir}"/>
  370. </classpath>
  371. </javac>
  372. <copy todir="${build.sandbox-classes.dir}">
  373. <fileset dir="${src.sandbox.dir}">
  374. <include name="META-INF/**"/>
  375. </fileset>
  376. </copy>
  377. </target>
  378. <!-- =================================================================== -->
  379. <!-- compiles hyphenation patterns -->
  380. <!-- =================================================================== -->
  381. <target name="compile-hyphenation" depends="compile-java">
  382. <path id="hyph-classpath">
  383. <path refid="libs-build-classpath"/>
  384. <pathelement location="${build.classes.dir}"/>
  385. </path>
  386. <taskdef name="serHyph" classname="org.apache.fop.tools.anttasks.SerializeHyphPattern" classpathref="hyph-classpath"/>
  387. <mkdir dir="${build.classes.dir}/hyph"/>
  388. <serHyph targetDir="${build.classes.dir}/hyph">
  389. <fileset dir="${user.hyph.dir}">
  390. <include name="*.xml"/>
  391. </fileset>
  392. </serHyph>
  393. </target>
  394. <target name="uptodate-jar-hyphenation" depends="compile-hyphenation">
  395. <uptodate property="jar.hyphenation.uptodate" targetfile="${build.dir}/fop-hyph.jar">
  396. <srcfiles dir="${build.classes.dir}/hyph"/>
  397. </uptodate>
  398. </target>
  399. <target name="jar-hyphenation" depends="compile-hyphenation,uptodate-jar-hyphenation" description="Generates the hyphenation jar file" unless="jar.hyphenation.uptodate">
  400. <tstamp>
  401. <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
  402. </tstamp>
  403. <jar jarfile="${build.dir}/fop-hyph.jar" basedir="${build.classes.dir}" includes="hyph/*.hyp">
  404. <manifest>
  405. <attribute name="Implementation-Title" value="${Name}"/>
  406. <attribute name="Implementation-Version" value="${version}"/>
  407. <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
  408. <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
  409. </manifest>
  410. </jar>
  411. </target>
  412. <target name="uptodate-jar-main" depends="compile-java">
  413. <uptodate property="jar.main.uptodate" targetfile="${build.dir}/fop.jar">
  414. <srcfiles dir= "${build.classes.dir}"/>
  415. </uptodate>
  416. </target>
  417. <target name="jar-main" depends="compile-java,uptodate-jar-main" description="Generates the main jar file" unless="jar.main.uptodate">
  418. <tstamp>
  419. <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
  420. </tstamp>
  421. <pathconvert property="manifest.classpath" dirsep="/" pathsep=" " refid="libs-build-classpath">
  422. <map from="${basedir}${file.separator}lib${file.separator}" to=""/>
  423. <map from="${optional.lib.dir}${file.separator}" to=""/>
  424. </pathconvert>
  425. <jar jarfile="${build.dir}/fop.jar" basedir="${build.classes.dir}">
  426. <manifest>
  427. <attribute name="Main-Class" value="org.apache.fop.cli.Main"/>
  428. <attribute name="Class-Path" value="${manifest.classpath}"/>
  429. <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
  430. <section name="org/apache/fop/">
  431. <attribute name="Specification-Title" value="XSL-FO - Extensible Stylesheet Language"/>
  432. <attribute name="Specification-Version" value="1.0"/>
  433. <attribute name="Specification-Vendor" value="World Wide Web Consortium"/>
  434. <attribute name="Specification-URL" value="http://www.w3.org/TR/xsl"/>
  435. <attribute name="Implementation-Title" value="${Name}"/>
  436. <attribute name="Implementation-Version" value="${version}"/>
  437. <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
  438. <attribute name="Implementation-URL" value="http://xmlgraphics.apache.org/fop/"/>
  439. </section>
  440. </manifest>
  441. </jar>
  442. </target>
  443. <target name="uptodate-jar-sandbox" depends="compile-java">
  444. <uptodate property="jar.sandbox.uptodate" targetfile="${build.dir}/fop-sandbox.jar">
  445. <srcfiles dir= "${build.sandbox-classes.dir}"/>
  446. </uptodate>
  447. </target>
  448. <target name="jar-sandbox" depends="compile-java,uptodate-jar-sandbox" description="Generates the sandbox jar file" unless="jar.sandbox.uptodate">
  449. <tstamp>
  450. <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
  451. </tstamp>
  452. <jar jarfile="${build.dir}/fop-sandbox.jar" basedir="${build.sandbox-classes.dir}">
  453. <manifest>
  454. <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
  455. </manifest>
  456. </jar>
  457. </target>
  458. <!-- =================================================================== -->
  459. <!-- Creates the class package -->
  460. <!-- =================================================================== -->
  461. <target name="package" depends="jar-main,jar-hyphenation,jar-sandbox" description="Generates the jar files"/>
  462. <target name="servlet" depends="package" description="Generates the WAR with the sample FOP servlet">
  463. <echo message="Creating the WAR file"/>
  464. <war warfile="${build.dir}/fop.war" webxml="${src.dir}/conf/web.xml">
  465. <lib dir="${lib.dir}">
  466. <include name="avalon-framework*.jar"/>
  467. <include name="commons-logging*.jar"/>
  468. <include name="batik*.jar"/>
  469. <include name="commons-io*.jar"/>
  470. <include name="xmlgraphics*.jar"/>
  471. </lib>
  472. <lib dir="${build.dir}">
  473. <include name="fop.jar"/>
  474. </lib>
  475. </war>
  476. </target>
  477. <patternset id="transcoder-classes">
  478. <!-- General classes -->
  479. <patternset>
  480. <include name="org/apache/fop/Version.class"/>
  481. <include name="org/apache/fop/apps/Fop.class"/>
  482. <include name="org/apache/fop/apps/FOPException.class"/>
  483. <include name="org/apache/fop/fo/Constants.class"/>
  484. <include name="org/apache/fop/fo/FOTreeBuilder.class"/>
  485. <include name="org/apache/fop/area/AreaTreeControl*"/>
  486. <include name="org/apache/fop/svg/**"/>
  487. <include name="org/apache/fop/fonts/**"/>
  488. <include name="org/apache/fop/image/FopImag*.class"/>
  489. <include name="org/apache/fop/image/Jpeg*"/>
  490. <include name="org/apache/fop/image/EPS*"/>
  491. <include name="org/apache/fop/image/Abstract*"/>
  492. <include name="org/apache/fop/image/analyser/*.class"/>
  493. <include name="org/apache/fop/util/CMYKColorSpace*.class"/>
  494. <include name="org/apache/fop/util/ASCII*.class"/>
  495. <include name="org/apache/fop/util/*OutputStream.class"/>
  496. <include name="org/apache/fop/util/SubInputStream.class"/>
  497. <include name="org/apache/fop/util/Finalizable.class"/>
  498. </patternset>
  499. <!-- PDF transcoder -->
  500. <patternset>
  501. <include name="org/apache/fop/render/pdf/**"/>
  502. <exclude name="org/apache/fop/render/pdf/PDFRenderer.class"/>
  503. <exclude name="org/apache/fop/render/pdf/PDFXMLHandler*"/>
  504. <include name="org/apache/fop/pdf/**"/>
  505. </patternset>
  506. <!-- PS transcoder -->
  507. <patternset>
  508. <include name="org/apache/fop/render/ps/**"/>
  509. <exclude name="org/apache/fop/render/pdf/PSRenderer.class"/>
  510. <exclude name="org/apache/fop/render/pdf/PSXMLHandler*"/>
  511. </patternset>
  512. </patternset>
  513. <fileset dir="${build.classes.dir}" id="transcoder-classes-files">
  514. <patternset refid="transcoder-classes"/>
  515. </fileset>
  516. <fileset dir="${lib.dir}" id="transcoder-lib-files">
  517. <include name="commons-io*.jar"/>
  518. <include name="avalon-framework*.jar"/>
  519. <include name="commons-logging*.jar"/>
  520. <include name="xmlgraphics-commons*.jar"/>
  521. </fileset>
  522. <target name="uptodate-transcoder-pkg" depends="compile-java">
  523. <uptodate property="transcoder.pkg.uptodate" targetfile="${build.dir}/fop-transcoder.jar">
  524. <srcfiles refid="transcoder-classes-files"/>
  525. <srcfiles refid="transcoder-lib-files"/>
  526. </uptodate>
  527. </target>
  528. <target name="transcoder-pkg" depends="uptodate-transcoder-pkg, compile-java" description="Generates the jar for the transcoder package for Batik" unless="transcoder.pkg.uptodate">
  529. <echo message="Creating the jar file ${build.dir}/fop-transcoder.jar"/>
  530. <property name="fop-transcoder.name" value="FOP Transcoder Package"/>
  531. <property name="fop-transcoder.version" value="1.0beta2"/>
  532. <tstamp>
  533. <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
  534. </tstamp>
  535. <!-- lean transcoder jar -->
  536. <jar jarfile="${build.dir}/fop-transcoder.jar">
  537. <fileset refid="transcoder-classes-files"/>
  538. <manifest>
  539. <attribute name="Implementation-Title" value="${fop-transcoder.name}"/>
  540. <attribute name="Implementation-Version" value="${fop-transcoder.version}"/>
  541. <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
  542. <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
  543. </manifest>
  544. </jar>
  545. <!-- all-in-one transcoder jar -->
  546. <property name="transcoder-deps" value="${build.dir}/transcoder-dependencies"/>
  547. <mkdir dir="${transcoder-deps}"/>
  548. <unjar dest="${transcoder-deps}">
  549. <patternset>
  550. <include name="org/apache/avalon/framework/*"/>
  551. <include name="org/apache/avalon/framework/activity/*"/>
  552. <include name="org/apache/avalon/framework/configuration/*"/>
  553. <include name="org/apache/avalon/framework/container/*"/>
  554. <include name="org/apache/commons/logging/**"/>
  555. <include name="org/apache/commons/io/CopyUtils.class"/>
  556. <include name="org/apache/commons/io/IOUtils.class"/>
  557. <include name="org/apache/commons/io/output/ProxyOutputStream.class"/>
  558. <include name="org/apache/commons/io/output/ByteArrayOutputStream.class"/>
  559. <include name="org/apache/commons/io/output/CountingOutputStream.class"/>
  560. <!-- TODO Remove the following lines once Batik switches over to using XML Graphics Commons -->
  561. <include name="org/apache/xmlgraphics/java2d/**"/>
  562. <include name="org/apache/xmlgraphics/ps/**"/>
  563. <include name="org/apache/xmlgraphics/fonts/**"/>
  564. <include name="org/apache/xmlgraphics/util/io/**"/>
  565. </patternset>
  566. <fileset refid="transcoder-lib-files"/>
  567. </unjar>
  568. <mkdir dir="${transcoder-deps}/legal"/>
  569. <copy todir="${transcoder-deps}/legal">
  570. <fileset dir="${lib.dir}">
  571. <include name="avalon.LICENSE.txt"/>
  572. <include name="commons-io.LICENSE.txt"/>
  573. <include name="commons-logging.LICENSE.txt"/>
  574. </fileset>
  575. </copy>
  576. <jar jarfile="${build.dir}/fop-transcoder-allinone.jar">
  577. <fileset refid="transcoder-classes-files"/>
  578. <fileset dir="${transcoder-deps}"/>
  579. <manifest>
  580. <attribute name="Implementation-Title" value="${fop-transcoder.name}"/>
  581. <attribute name="Implementation-Version" value="${fop-transcoder.version}"/>
  582. <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
  583. <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
  584. </manifest>
  585. </jar>
  586. </target>
  587. <target name="all" depends="package, servlet, transcoder-pkg, junit"/> <!-- "all" target for us Makefile converts ;-) -->
  588. <!-- =================================================================== -->
  589. <!-- Testing -->
  590. <!-- =================================================================== -->
  591. <target name="junit-with-xmlunit" depends="init-avail" if="xmlunit.present">
  592. <patternset id="test-sources"/>
  593. </target>
  594. <target name="junit-without-xmlunit" depends="init-avail" unless="xmlunit.present">
  595. <patternset id="test-sources">
  596. <exclude name="**/intermediate/*"/>
  597. </patternset>
  598. </target>
  599. <target name="junit-compile" depends="package, transcoder-pkg, junit-with-xmlunit, junit-without-xmlunit" description="Runs FOP's JUnit tests" if="junit.present">
  600. <mkdir dir="${build.dir}/test-classes"/>
  601. <mkdir dir="${build.dir}/test-reports"/>
  602. <javac destdir="${build.dir}/test-classes" fork="${javac.fork}"
  603. debug="${javac.debug}" deprecation="${javac.deprecation}"
  604. optimize="${javac.optimize}" source="${javac.source}"
  605. target="${javac.target}">
  606. <src path="${basedir}/test/java"/>
  607. <patternset refid="test-sources"/>
  608. <classpath>
  609. <path refid="libs-build-classpath"/>
  610. <fileset dir="${build.dir}">
  611. <include name="fop.jar"/>
  612. </fileset>
  613. </classpath>
  614. </javac>
  615. </target>
  616. <target name="junit-transcoder" depends="junit-compile" description="Runs FOP's JUnit transcoder tests" if="junit.present">
  617. <echo message="Running basic functionality tests for fop-transcoder.jar"/>
  618. <junit haltonerror="no" fork="${junit.fork}">
  619. <sysproperty key="basedir" value="${basedir}"/>
  620. <sysproperty key="jawa.awt.headless" value="true"/>
  621. <formatter type="brief" usefile="false"/>
  622. <formatter type="plain" usefile="true"/>
  623. <classpath>
  624. <pathelement location="${build.dir}/test-classes"/>
  625. <path refid="libs-build-classpath"/>
  626. <fileset dir="${build.dir}">
  627. <include name="fop-transcoder.jar"/>
  628. </fileset>
  629. </classpath>
  630. <test name="org.apache.fop.BasicTranscoderTestSuite" todir="${build.dir}/test-reports" outfile="TEST-transcoder"/>
  631. </junit>
  632. <echo message="Running basic functionality tests for fop-transcoder-allinone.jar"/>
  633. <!-- These are the same tests as in the block above but testing the "allinone" JAR
  634. instead. Please don't add any additional paths other than the test classes, the
  635. allinone JAR and the any Batik JARs to the classpath. If this fails, but the
  636. previous test block succeeded it indicates that the packaging of the allinone
  637. JAR needs to be updated.
  638. -->
  639. <junit haltonerror="no" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
  640. <sysproperty key="basedir" value="${basedir}"/>
  641. <sysproperty key="jawa.awt.headless" value="true"/>
  642. <formatter type="brief" usefile="false"/>
  643. <formatter type="plain" usefile="true"/>
  644. <classpath>
  645. <pathelement location="${build.dir}/test-classes"/>
  646. <fileset dir="build">
  647. <include name="fop-transcoder-allinone.jar"/>
  648. </fileset>
  649. <fileset dir="${lib.dir}">
  650. <include name="xml-apis*.jar"/>
  651. <include name="xerces*.jar"/>
  652. <include name="batik*.jar"/>
  653. </fileset>
  654. </classpath>
  655. <test name="org.apache.fop.BasicTranscoderTestSuite" todir="${build.dir}/test-reports" outfile="TEST-transcoder-allinone"/>
  656. </junit>
  657. </target>
  658. <target name="junit-basic" depends="junit-compile" description="Runs FOP's JUnit basic tests" if="junit.present">
  659. <echo message="Running basic functionality tests for fop.jar"/>
  660. <junit haltonerror="no" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
  661. <sysproperty key="basedir" value="${basedir}"/>
  662. <sysproperty key="jawa.awt.headless" value="true"/>
  663. <formatter type="brief" usefile="false"/>
  664. <formatter type="plain" usefile="true"/>
  665. <classpath>
  666. <pathelement location="${build.dir}/test-classes"/>
  667. <path refid="libs-build-classpath"/>
  668. <fileset dir="build">
  669. <include name="fop.jar"/>
  670. </fileset>
  671. </classpath>
  672. <test name="org.apache.fop.StandardTestSuite" todir="${build.dir}/test-reports"/>
  673. </junit>
  674. </target>
  675. <target name="hyphenation-present" depends="junit-compile" if="junit.present">
  676. <condition property="hyphenation.present">
  677. <and><!-- All the hyphenation files required by the layout test cases to be listed here -->
  678. <available resource="hyph/en.hyp" classpathref="libs-run-classpath"/>
  679. <available resource="hyph/de.hyp" classpathref="libs-run-classpath"/>
  680. </and>
  681. </condition>
  682. <condition property="hyphenation.message" value="Hyphenation Support PRESENT">
  683. <equals arg1="${hyphenation.present}" arg2="true"/>
  684. </condition>
  685. <condition property="hyphenation.message" value="Hyphenation Support NOT Present - Layout tests which require hyphenation are NOT being run!">
  686. <not>
  687. <equals arg1="${hyphenation.present}" arg2="true"/>
  688. </not>
  689. </condition>
  690. <echo message="${hyphenation.message}"/>
  691. </target>
  692. <target name="junit-layout-standard" depends="junit-compile" if="junit.present" description="Runs FOP's standard JUnit layout tests">
  693. <echo message="Running standard layout engine tests"/>
  694. <junit haltonerror="no" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
  695. <sysproperty key="basedir" value="${basedir}"/>
  696. <sysproperty key="jawa.awt.headless" value="true"/>
  697. <sysproperty key="fop.layoutengine.disabled" value="${layoutengine.disabled}"/>
  698. <sysproperty key="fop.layoutengine.testset" value="standard"/>
  699. <formatter type="brief" usefile="false"/>
  700. <formatter type="plain" usefile="true"/>
  701. <classpath>
  702. <pathelement location="${build.dir}/test-classes"/>
  703. <path refid="libs-run-classpath"/>
  704. </classpath>
  705. <test name="org.apache.fop.layoutengine.LayoutEngineTestSuite" todir="${build.dir}/test-reports" outfile="TEST-layoutengine-standard"/>
  706. </junit>
  707. </target>
  708. <target name="junit-layout-hyphenation" depends="hyphenation-present, junit-compile" if="hyphenation.present" description="Runs FOP's JUnit hyphenation layout tests">
  709. <echo message="Running hyphenation layout engine tests"/>
  710. <junit haltonerror="no" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
  711. <sysproperty key="basedir" value="${basedir}"/>
  712. <sysproperty key="jawa.awt.headless" value="true"/>
  713. <sysproperty key="fop.layoutengine.disabled" value="${layoutengine.disabled}"/>
  714. <sysproperty key="fop.layoutengine.testset" value="hyphenation"/>
  715. <formatter type="brief" usefile="false"/>
  716. <formatter type="plain" usefile="true"/>
  717. <classpath>
  718. <pathelement location="${build.dir}/test-classes"/>
  719. <path refid="libs-run-classpath"/>
  720. </classpath>
  721. <test name="org.apache.fop.layoutengine.LayoutEngineTestSuite" todir="${build.dir}/test-reports" outfile="TEST-layoutengine-hyphenation"/>
  722. </junit>
  723. </target>
  724. <target name="junit-layout" depends="junit-layout-standard, junit-layout-hyphenation" description="Runs all FOP's JUnit layout tests" />
  725. <target name="junit-fotree" depends="junit-compile" description="Runs FOP's FO tree JUnit tests" if="junit.present">
  726. <echo message="Running fo tree tests"/>
  727. <junit haltonerror="no" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
  728. <sysproperty key="basedir" value="${basedir}"/>
  729. <sysproperty key="jawa.awt.headless" value="true"/>
  730. <sysproperty key="fop.layoutengine.disabled" value="${fotree.disabled}"/>
  731. <formatter type="brief" usefile="false"/>
  732. <formatter type="plain" usefile="true"/>
  733. <classpath>
  734. <pathelement location="${build.dir}/test-classes"/>
  735. <path refid="libs-build-classpath"/>
  736. <fileset dir="build">
  737. <include name="fop.jar"/>
  738. </fileset>
  739. </classpath>
  740. <test name="org.apache.fop.fotreetest.FOTreeTestSuite" todir="${build.dir}/test-reports" outfile="TEST-FO-tree"/>
  741. </junit>
  742. </target>
  743. <target name="junit-intermediate-format" depends="junit-compile" description="Runs FOP's intermediate format JUnit tests" if="xmlunit.present">
  744. <echo message="Running intermediate format tests"/>
  745. <junit haltonerror="no" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
  746. <sysproperty key="basedir" value="${basedir}"/>
  747. <sysproperty key="jawa.awt.headless" value="true"/>
  748. <sysproperty key="fop.layoutengine.disabled" value="${layoutengine.disabled}"/>
  749. <sysproperty key="fop.layoutengine.testset" value="standard"/>
  750. <formatter type="brief" usefile="false"/>
  751. <formatter type="plain" usefile="true"/>
  752. <classpath>
  753. <pathelement location="${build.dir}/test-classes"/>
  754. <path refid="libs-build-classpath"/>
  755. <fileset dir="build">
  756. <include name="fop.jar"/>
  757. </fileset>
  758. </classpath>
  759. <test name="org.apache.fop.intermediate.IntermediateFormatTestSuite" todir="${build.dir}/test-reports" outfile="TEST-intermediate-format"/>
  760. </junit>
  761. </target>
  762. <target name="junit" depends="junit-basic, junit-transcoder, junit-layout, junit-fotree, junit-intermediate-format" description="Runs all of FOP's JUnit tests" if="junit.present">
  763. <fail>
  764. <condition>
  765. <or>
  766. <isset property="fop.junit.error"/>
  767. <isset property="fop.junit.failure"/>
  768. <not>
  769. <isset property="hyphenation.present"/>
  770. </not>
  771. </or>
  772. </condition>
  773. NOTE:
  774. **************************************************************************
  775. * One or more of the Junit tests had Failures or Errors or were skipped! *
  776. * Please check the output above for relevant messages. *
  777. **************************************************************************
  778. </fail>
  779. <echo>All Junit tests passed!</echo>
  780. </target>
  781. <!-- =================================================================== -->
  782. <!-- Creates the API documentation -->
  783. <!-- =================================================================== -->
  784. <target name="javadocs" depends="codegen" description="Generates javadocs">
  785. <!--condition property="javadoc.version.ok">
  786. <not>
  787. <or>
  788. <equals arg1="${ant.java.version}" arg2="1.1"/>
  789. <equals arg1="${ant.java.version}" arg2="1.2"/>
  790. <equals arg1="${ant.java.version}" arg2="1.3"/>
  791. </or>
  792. </not>
  793. </condition>
  794. <fail message="Building FOP javadocs requires at least Java 1.4" unless="javadoc.version.ok"/-->
  795. <property name="javadoc.public" value="false"/>
  796. <property name="javadoc.package" value="false"/>
  797. <property name="javadoc.private" value="false"/>
  798. <condition property="javadoc.level" value=" (level: private)">
  799. <equals arg1="${javadoc.private}" arg2="true"/>
  800. </condition>
  801. <condition property="javadoc.level" value=" (level: package)">
  802. <equals arg1="${javadoc.package}" arg2="true"/>
  803. </condition>
  804. <condition property="javadoc.level" value=" (level: public)">
  805. <equals arg1="${javadoc.public}" arg2="true"/>
  806. </condition>
  807. <property name="javadoc.level" value=""/>
  808. <echo message="Producing the javadoc files${javadoc.level}"/>
  809. <mkdir dir="${build.javadocs.dir}"/>
  810. <javadoc
  811. packagenames="${javadoc.packages}"
  812. destdir="${build.javadocs.dir}"
  813. author="true"
  814. version="true"
  815. windowtitle="${Name} ${version} API"
  816. doctitle="Apache Formatting Objects Processor (FOP)"
  817. bottom="Copyright ${year} The Apache Software Foundation. All Rights Reserved."
  818. overview="${src.dir}/java/org/apache/fop/overview.html"
  819. use="true"
  820. failonerror="true"
  821. public="${javadoc.public}"
  822. package="${javadoc.package}"
  823. private="${javadoc.private}">
  824. <header><![CDATA[${name} ${version}]]></header>
  825. <footer><![CDATA[${name} ${version}]]></footer>
  826. <classpath>
  827. <path refid="libs-build-classpath"/>
  828. <pathelement path="${java.class.path}"/>
  829. </classpath>
  830. <sourcepath>
  831. <pathelement path="${src.java.dir}"/>
  832. <pathelement path="${src.sandbox.dir}"/>
  833. <pathelement path="${build.gensrc.dir}"/>
  834. <path refid="graphics-configuration-adapter"/>
  835. </sourcepath>
  836. <tag name="todo" scope="all" description="To do:"/>
  837. <group title="Control and Startup">
  838. <package name="org.apache.fop"/>
  839. <package name="org.apache.fop.apps"/>
  840. <package name="org.apache.fop.cli"/>
  841. <package name="org.apache.fop.configuration"/>
  842. <package name="org.apache.fop.messaging"/>
  843. <package name="org.apache.fop.servlet"/>
  844. </group>
  845. <group title="XSL-FO Tree">
  846. <package name="org.apache.fop.fo"/>
  847. <package name="org.apache.fop.fo.*"/>
  848. <package name="org.apache.fop.datatypes"/>
  849. <package name="org.apache.fop.extensions"/>
  850. </group>
  851. <group title="Layout">
  852. <package name="org.apache.fop.layoutmgr"/>
  853. <package name="org.apache.fop.layoutmgr.*"/>
  854. </group>
  855. <group title="Area Tree">
  856. <package name="org.apache.fop.area"/>
  857. <package name="org.apache.fop.area.*"/>
  858. <package name="org.apache.fop.traits"/>
  859. </group>
  860. <group title="Paginated Rendering">
  861. <package name="org.apache.fop.render"/>
  862. <package name="org.apache.fop.render.*"/>
  863. </group>
  864. <group title="Structural Rendering">
  865. <package name="org.apache.fop.render.rtf"/>
  866. <package name="org.apache.fop.render.mif"/>
  867. </group>
  868. <group title="Utility">
  869. <package name="org.apache.fop.hyphenation"/>
  870. <package name="org.apache.fop.pdf"/>
  871. <package name="org.apache.fop.tools"/>
  872. <package name="org.apache.fop.tools.*"/>
  873. <package name="org.apache.fop.svg"/>
  874. <package name="org.apache.fop.image"/>
  875. <package name="org.apache.fop.image.*"/>
  876. <package name="org.apache.fop.fonts"/>
  877. <package name="org.apache.fop.fonts.*"/>
  878. <package name="org.apache.fop.util"/>
  879. </group>
  880. <group title="RTFLib (formerly JFor) Subpackage Candidate">
  881. <package name="org.apache.fop.render.rtf.rtflib"/>
  882. <package name="org.apache.fop.render.rtf.rtflib.*"/>
  883. </group>
  884. </javadoc>
  885. </target>
  886. <!-- =================================================================== -->
  887. <!-- Checkstyle -->
  888. <!-- =================================================================== -->
  889. <property name="checkstyle.home.dir" value="${optional.lib.dir}"/>
  890. <property name="checkstyle.noframes.xslt" value="${checkstyle.home.dir}/contrib/checkstyle-noframes.xsl"/>
  891. <path id="checkstyle-path">
  892. <fileset dir="${basedir}/lib">
  893. <include name="checkstyle-all-*.jar"/>
  894. <include name="checkstyle-*.jar"/>
  895. <include name="antlr*.jar"/>
  896. <include name="commons-beanutils*.jar"/>
  897. <include name="commons-collections*.jar"/>
  898. <include name="commons-logging*.jar"/>
  899. <include name="jakarta-regexp*.jar"/>
  900. </fileset>
  901. <fileset dir="${checkstyle.home.dir}">
  902. <include name="checkstyle-all-*.jar"/>
  903. <include name="checkstyle-*.jar"/>
  904. <include name="antlr*.jar"/>
  905. <include name="commons-beanutils*.jar"/>
  906. <include name="commons-collections*.jar"/>
  907. <include name="commons-logging*.jar"/>
  908. <include name="jakarta-regexp*.jar"/>
  909. </fileset>
  910. <!--fileset dir="${optional.lib.dir}">
  911. <include name="checkstyle-all-*.jar"/>
  912. <include name="checkstyle-*.jar"/>
  913. <include name="antlr*.jar"/>
  914. <include name="commons-beanutils*.jar"/>
  915. <include name="commons-collections*.jar"/>
  916. <include name="commons-logging*.jar"/>
  917. <include name="jakarta-regexp*.jar"/>
  918. </fileset-->
  919. </path>
  920. <path id="checkstyle-runpath">
  921. <path refid="checkstyle-path"/>
  922. <fileset dir="${basedir}/build">
  923. <include name="fop.jar"/>
  924. <include name="fop-hyph.jar" />
  925. </fileset>
  926. </path>
  927. <target name="checkstyle-avail" depends="init">
  928. <available property="checkstyle.available" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstyle-path"/>
  929. <available property="checkstyle.4.x" classname="com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariableCheck" classpathref="checkstyle-path"/>
  930. <available property="checkstyle.noframes.xslt.available" file="${checkstyle.noframes.xslt}"/>
  931. <condition property="checkstyle.message" value="Checkstyle 4.x Support PRESENT">
  932. <and>
  933. <equals arg1="${checkstyle.available}" arg2="true"/>
  934. <equals arg1="${checkstyle.4.x}" arg2="true"/>
  935. </and>
  936. </condition>
  937. <condition property="checkstyle.message" value="Checkstyle 3.x Support PRESENT">
  938. <equals arg1="${checkstyle.available}" arg2="true"/>
  939. </condition>
  940. <condition property="checkstyle.message" value="Checkstyle Support NOT Present">
  941. <not>
  942. <equals arg1="${checkstyle.available}" arg2="true"/>
  943. </not>
  944. </condition>
  945. <echo message="${checkstyle.message}"/>
  946. <condition property="checkstyle.config" value="checkstyle-4.0.xml">
  947. <equals arg1="${checkstyle.4.x}" arg2="true"/>
  948. </condition>
  949. <condition property="checkstyle.config" value="checkstyle-3.5-fop-head.xml">
  950. <not>
  951. <equals arg1="${checkstyle.4.x}" arg2="true"/>
  952. </not>
  953. </condition>
  954. <condition property="checkstyle.noframes.xslt.message" value="Checkstyle HTML style sheet support PRESENT">
  955. <equals arg1="${checkstyle.noframes.xslt.available}" arg2="true"/>
  956. </condition>
  957. <condition property="checkstyle.noframes.xslt.message" value="Checkstyle HTML style sheet support NOT Present">
  958. <not>
  959. <equals arg1="${checkstyle.noframes.xslt.available}" arg2="true"/>
  960. </not>
  961. </condition>
  962. <echo message="${checkstyle.noframes.xslt.message}"/>
  963. </target>
  964. <target name="checkstyle-check" depends="checkstyle-avail, codegen" if="checkstyle.available">
  965. <taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstyle-runpath"/>
  966. <checkstyle config="${checkstyle.config}" failonviolation="false"
  967. classpathref="checkstyle-runpath">
  968. <fileset dir="${src.java.dir}" includes="**/*.java"/>
  969. <formatter type="plain" toFile="${build.dir}/checkstyle_report.txt"/>
  970. <formatter type="xml" toFile="${build.dir}/checkstyle_report.xml"/>
  971. </checkstyle>
  972. </target>
  973. <target name="checkstyle-html" depends="checkstyle-avail, checkstyle-check" if="checkstyle.noframes.xslt.available">
  974. <style in="${build.dir}/checkstyle_report.xml" out="${build.dir}/checkstyle_report.html" style="${checkstyle.noframes.xslt}"/>
  975. </target>
  976. <target name="checkstyle" depends="checkstyle-avail, checkstyle-check, checkstyle-html" description="Runs Checkstyle for a code quality report"/>
  977. <!-- =================================================================== -->
  978. <!-- Creates the documentation -->
  979. <!-- =================================================================== -->
  980. <target name="docs" description="Generates documentation">
  981. <echo message="Building documentation with Forrest..."/>
  982. <!--
  983. <echo message="Make sure that you have installed Apache Forrest and"/>
  984. <echo message="the FORREST_HOME environment variable is set (see http://forrest.apache.org/)"/>
  985. <echo message="FORREST_HOME = ${forrest.home}"/>
  986. -->
  987. <echo message="Make sure you have a proper Forrest installation (see http://forrest.apache.org/)"/>
  988. <!--<antcall target="site"/>-->
  989. <!-- You can provide a JDK 1.4 for a JDK 1.3 build by adding "javahome.jdk14" to build-local.properties -->
  990. <condition property="javahome.jdk14.override" value="${javahome.jdk14}">
  991. <isset property="javahome.jdk14"/>
  992. </condition>
  993. <echo message="java home: ${javahome.jdk14.override}"/>
  994. <condition property="javahome.jdk14.override" value="${env.JAVA_HOME}">
  995. <not>
  996. <isset property="javahome.jdk14.override"/>
  997. </not>
  998. </condition>
  999. <echo message="java home: ${javahome.jdk14.override}"/>
  1000. <condition property="forrest.call" value="forrest.bat" else="forrest">
  1001. <os family="windows"/>
  1002. </condition>
  1003. <exec executable="${forrest.call}">
  1004. <env key="JAVA_HOME" value="${javahome.jdk14.override}"/>
  1005. </exec>
  1006. </target>
  1007. <!-- =================================================================== -->
  1008. <!-- Creates the distribution -->
  1009. <!-- =================================================================== -->
  1010. <target name="dist" depends="dist-src,dist-bin" description="Generates the distribution package"/>
  1011. <target name="dist-bin" depends="all,javadocs,docs">
  1012. <echo message="Building the binary distribution files (zip,tar)"/>
  1013. <fail message="A complete binary build requires Jimi" unless="jimi.present"/>
  1014. <fail message="A complete binary build requires JAI" unless="jai.present"/>
  1015. <fail message="A complete binary build requires JCE" unless="jce.present"/>
  1016. <mkdir dir="${dist.bin.result.dir}"/>
  1017. <copy todir="${dist.bin.result.dir}">
  1018. <fileset refid="dist.bin"/>
  1019. <fileset refid="dist.bin.lib"/>
  1020. </copy>
  1021. <copy todir="${dist.bin.result.dir}/docs">
  1022. <fileset dir="${build.dir}/site"/>
  1023. </copy>
  1024. <copy todir="${dist.bin.result.dir}/javadocs">
  1025. <fileset dir="${build.javadocs.dir}"/>
  1026. </copy>
  1027. <mkdir dir="${dist.bin.result.dir}/build"/>
  1028. <copy todir="${dist.bin.result.dir}/build" file="build/fop.jar"/>
  1029. <chmod file="${dist.bin.result.dir}/fop" perm="ugo+rx"/>
  1030. <property name="bin.suffix" value="bin-jdk${java.specification.version}"/>
  1031. <zip zipfile="${name}-${version}-${bin.suffix}.zip" basedir="${dist.bin.dir}" includes="**"/>
  1032. <tar longfile="gnu"
  1033. destfile="${name}-${version}-${bin.suffix}.tar">
  1034. <tarfileset dir="${dist.bin.dir}" mode="755">
  1035. <include name="${name}-${version}/fop"/>
  1036. </tarfileset>
  1037. <tarfileset dir="${dist.bin.dir}">
  1038. <include name="**"/>
  1039. <exclude name="${name}-${version}/fop"/>
  1040. </tarfileset>
  1041. </tar>
  1042. <gzip zipfile="${name}-${version}-${bin.suffix}.tar.gz" src="${name}-${version}-${bin.suffix}.tar"/>
  1043. <delete file="${name}-${version}-${bin.suffix}.tar"/>
  1044. </target>
  1045. <target name="dist-src" depends="all">
  1046. <echo message="Building the source distribution files (zip,tar)"/>
  1047. <mkdir dir="${dist.src.result.dir}"/>
  1048. <copy todir="${dist.src.result.dir}">
  1049. <fileset refid="dist.src"/>
  1050. </copy>
  1051. <chmod file="${dist.src.result.dir}/fop" perm="ugo+rx"/>
  1052. <zip zipfile="${name}-${version}-src.zip" basedir="${dist.src.dir}" includes="**"/>
  1053. <tar longfile="gnu"
  1054. destfile="${name}-${version}-src.tar" >
  1055. <tarfileset dir="${dist.src.dir}" mode="755">
  1056. <include name="${name}-${version}/fop"/>
  1057. </tarfileset>
  1058. <tarfileset dir="${dist.src.dir}">
  1059. <include name="**"/>
  1060. <exclude name="${name}-${version}/fop"/>
  1061. </tarfileset>
  1062. </tar>
  1063. <gzip zipfile="${name}-${version}-src.tar.gz" src="${name}-${version}-src.tar"/>
  1064. <delete file="${name}-${version}-src.tar"/>
  1065. </target>
  1066. <!-- =================================================================== -->
  1067. <!-- Generate example PDFs -->
  1068. <!-- =================================================================== -->
  1069. <target name="examples" depends="package" description="Generates example PDF files">
  1070. <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop"
  1071. classpathref="libs-run-classpath"/>
  1072. <mkdir dir="${build.examples.dir}"/>
  1073. <fop format="${build.property.examples.mime.type}" outdir="${build.examples.dir}"
  1074. messagelevel="debug" basedir="${fo.examples.dir}">
  1075. <fileset dir="${fo.examples.dir}">
  1076. <include name="**/*.fo"/>
  1077. </fileset>
  1078. </fop>
  1079. </target>
  1080. <!-- =================================================================== -->
  1081. <!-- Helper task to generate source files that have already been -->
  1082. <!-- checked into CVS. For these files, CVS version is the official one -->
  1083. <!-- and may have updates that will *not* be generated by below. This -->
  1084. <!-- target should never be part of the normal build process. -->
  1085. <!-- =================================================================== -->
  1086. <target name="xsltToJava" >
  1087. <style in="src\codegen\constants.xml" style="src\codegen\constants.xsl"
  1088. out="Constants.java"/>
  1089. <style in="src/codegen/foelements.xml" style="src/codegen/property-sets.xsl"
  1090. out="PropertySets.java"/>
  1091. </target>
  1092. <!-- =================================================================== -->
  1093. <!-- Special target for Gump -->
  1094. <!-- =================================================================== -->
  1095. <target name="gump" depends="all, javadocs"/>
  1096. <!-- =================================================================== -->
  1097. <!-- Clean targets -->
  1098. <!-- =================================================================== -->
  1099. <target name="clean" description="Cleans the build directory">
  1100. <delete dir="${build.dir}"/>
  1101. </target>
  1102. <target name="distclean" depends="clean" description="Cleans the distribution target directories">
  1103. <delete dir="${dist.src.dir}"/>
  1104. <delete dir="${dist.bin.dir}"/>
  1105. <delete>
  1106. <fileset dir="${basedir}" includes="${name}-*.tar.gz"/>
  1107. <fileset dir="${basedir}" includes="${name}-*.zip"/>
  1108. </delete>
  1109. </target>
  1110. <target name="validate-xdocs" description="Validate the
  1111. xdocs. Point schemas.dir to Forrest's 'schemas' directory.">
  1112. <property name="schemas.dir" value="../xml-forrest/src/resources/schema"/>
  1113. <xmlvalidate failonerror="no">
  1114. <fileset dir="${xdocs.dir}" includes="**.xml"/>
  1115. <xmlcatalog>
  1116. <entity publicId="-//APACHE//DTD Compliance V1.0//EN"
  1117. location="src/documentation/resources/schema/dtd/compliance-v10.dtd"/>
  1118. <entity publicId="-//APACHE//DTD Documentation V1.1//EN"
  1119. location="${schemas.dir}/dtd/document-v11.dtd"/>
  1120. <entity publicId="-//APACHE//DTD Specification V1.1//EN"
  1121. location="${schemas.dir}/dtd/specification-v11.dtd"/>
  1122. <entity publicId="-//APACHE//DTD FAQ V1.1//EN"
  1123. location="${schemas.dir}/dtd/faq-v11.dtd"/>
  1124. <entity publicId="-//APACHE//DTD Changes V1.1//EN"
  1125. location="${schemas.dir}/dtd/changes-v11.dtd"/>
  1126. <entity publicId="-//APACHE//DTD Todo V1.1//EN"
  1127. location="${schemas.dir}/dtd/todo-v11.dtd"/>
  1128. <entity publicId="-//APACHE//DTD Cocoon Documentation Book V1.0//EN"
  1129. location="${schemas.dir}/dtd/book-cocoon-v10.dtd"/>
  1130. <entity publicId="-//APACHE//DTD Cocoon Documentation Tab V1.0//EN"
  1131. location="${schemas.dir}/dtd/tab-cocoon-v10.dtd"/>
  1132. <entity publicId="-//APACHE//DTD How-to V1.0//EN"
  1133. location="${schemas.dir}/dtd/howto-v10.dtd"/>
  1134. <entity publicId="-//APACHE//DTD Gump Descriptor V1.0//EN"
  1135. location="${schemas.dir}/dtd/xgump-draft.dtd"/>
  1136. <entity publicId="-//APACHE//DTD JavaDoc V1.0//EN"
  1137. location="${schemas.dir}/dtd/javadoc-v04draft.dtd"/>
  1138. <entity publicId="-//APACHE//DTD Contributors V1.0//EN"
  1139. location="${schemas.dir}/dtd/contributors-v10.dtd"/>
  1140. <entity publicId="-//Outerthought//DTD Libre Configuration V0.1//EN"
  1141. location="${schemas.dir}/dtd/libre-v01.dtd"/>
  1142. <entity publicId="-//APACHE//ENTITIES Documentation V1.1//EN"
  1143. location="${schemas.dir}/dtd/document-v11.mod"/>
  1144. <entity publicId="-//APACHE//ENTITIES FAQ V1.1//EN"
  1145. location="${schemas.dir}/dtd/faq-v11.mod"/>
  1146. <entity publicId="-//APACHE//ENTITIES Todo V1.1//EN"
  1147. location="${schemas.dir}/dtd/todo-v11.mod"/>
  1148. <entity publicId="-//APACHE//ENTITIES Common Elements V1.0//EN"
  1149. location="${schemas.dir}/dtd/common-elems-v10.mod"/>
  1150. <entity publicId="-//APACHE//ENTITIES Common Character Entity Sets V1.0//EN"
  1151. location="${schemas.dir}/dtd/common-charents-v10.mod"/>
  1152. <entity publicId="ISO 8879-1986//ENTITIES Added Latin 1//EN//XML"
  1153. location="${schemas.dir}/entity/ISOlat1.pen"/>
  1154. <entity publicId="ISO 9573-15:1993//ENTITIES Greek Letters//EN//XML"
  1155. location="${schemas.dir}/entity/ISOgrk1.pen"/>
  1156. <entity publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
  1157. location="${schemas.dir}/entity/ISOpub.pen"/>
  1158. <entity publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
  1159. location="${schemas.dir}/entity/ISOtech.pen"/>
  1160. <entity publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
  1161. location="${schemas.dir}/entity/ISOnum.pen"/>
  1162. <entity publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
  1163. location="${schemas.dir}/entity/ISOdia.pen"/>
  1164. <entity publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
  1165. location="${schemas.dir}/entity/ISOlat1.pen"/>
  1166. </xmlcatalog>
  1167. </xmlvalidate>
  1168. </target>
  1169. </project>