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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. <?xml version="1.0"?>
  2. <!-- ===========================================================================
  3. * ================= *
  4. | How to build Fop |
  5. * ================= *
  6. Adaption from the Cocoon build.xml written by Stefano Mazzocchi
  7. by Giacomo Pati with some addition by Fotis Jannidis
  8. Introduction
  9. ============
  10. FOP is the world's first print formatter driven by XSL formatting objects. It
  11. is a Java 1.2 application that reads a formatting object tree and then turns
  12. it into a PDF document. The formatting object tree, can be in the form of an
  13. XML document (output by an XSLT engine like Xalan) or can be passed in
  14. memory as a DOM Document or SAX events.
  15. FOP is part of Apache's XML project. The homepage of FOP is
  16. http:/xml.apache.org/fop
  17. HTML-Documentation can be found in the subdirectory ./docs.
  18. Installing the build tools
  19. ==========================
  20. The Fop build system is based on Jakarta Ant, which is a Java building tool
  21. originally developed for the Jakarta Tomcat project but now used in many other
  22. Apache projects and extended by many developers.
  23. Ant is a little but very handy tool that uses a build file written in XML
  24. (this file) as building instructions. For more information refer to
  25. "http://jakarta.apache.org/ant/".
  26. To make things easier for you, the Fop distribution contains a
  27. precompiled version of Ant and the build scripts take care of all the
  28. classpath issues except the following:
  29. You need to have xerces.jar and xalan.jar in your classpath. You can get
  30. those from http://xml.apache.org/xerces and http://xml.apache.org/xalan
  31. respectively.
  32. Additionaly you have to make sure, that the "JAVA_HOME" environment
  33. property should be set to match the JVM you want to use. That's it.
  34. Building instructions
  35. =====================
  36. First, make sure your current working directory is where this very file is
  37. located. Then type
  38. ./build.sh (unix)
  39. .\build.bat (win32)
  40. if everything is right and all the required packages are visible, this action
  41. will generate a file called "fop.jar" in the "./build" directory. Note, that
  42. if you do further development, compilation time is reduced since Ant is able
  43. to detect which files have changed an to recompile them at need.
  44. If something went wrong, go to the FAQ section below.
  45. Also, you'll note that reusing a single JVM instance for each task, increases
  46. tremendously the performance of the whole build system, compared to other
  47. tools (i.e. make or shell scripts) where a new JVM is started for each task.
  48. Build targets
  49. =============
  50. The build system is not only responsible of compiling Fop into a jar file,
  51. but is also responsible for creating the HTML documentation, javadocs,
  52. distributions and web site. In fact, the file you have here is _exactly_ what
  53. is used by fop maintainers to take care of everything in the Fop
  54. project, no less and no more. (only partially implemented)
  55. These are the meaningful targets for this build file:
  56. - package [default] -> creates ./build/fop.jar
  57. - usage -> shows a help screen
  58. - codegen -> generates needed java sources from xml resources
  59. - htmldoc -> generates the HTML documentation in ./build/docs/html-docs
  60. - javadocs -> generates the API documentation in ./build/javadocs
  61. - pdfdoc -> generates the PDF documentation in ./build/docs/xml-docs
  62. - dist -> generates the Fop distribution
  63. - clean -> restores the distribution to its original and clean state
  64. (excepting dist files)
  65. - distclean -> restores the distribution to its original and clean state
  66. - site -> generates the web site in ../xml-site/targets/fop (not yet impl.)
  67. ====================================== FAQ =====================================
  68. 1) Why some of the classes present in the original jar are not built anymore?
  69. The fop build system is very flexible: if a module requires a package that
  70. is not present in the classpath at build time, the module is skipped but
  71. the built process is not stopped.
  72. 2) I see a lot of warnings starting like this: "Warning: file modified in the future:"
  73. Sometimes ant gives out this warnings, but the build is finished without any problems
  74. ============================================================================ -->
  75. <project default="package" basedir=".">
  76. <fileset dir="${basedir}" id="dist.bin">
  77. <include name="conf/**"/>
  78. <include name="docs/**"/>
  79. <include name="hyph/**"/>
  80. <include name="CHANGES"/>
  81. <include name="LICENSE"/>
  82. <include name="README"/>
  83. <include name="STATUS"/>
  84. <include name="fop.bat"/>
  85. <include name="fop.sh"/>
  86. <exclude name="src/**"/>
  87. <exclude name="dist/**"/>
  88. <exclude name="build/**"/>
  89. <exclude name="lib/**"/>
  90. </fileset>
  91. <fileset dir="${basedir}" id="dist.bin.lib">
  92. <include name="lib/xerces-1.4.3.jar"/>
  93. <include name="lib/xalan-2.2D11.jar"/>
  94. <include name="lib/batik.jar"/>
  95. <include name="lib/avalon-framework-cvs-20020315.jar"/>
  96. <include name="lib/jimi*"/>
  97. </fileset>
  98. <fileset dir="${basedir}" id="dist.src">
  99. <exclude name="lib/classes/**"/>
  100. <exclude name="lib/org/**"/>
  101. <exclude name="lib/src/**"/>
  102. <exclude name="build/**"/>
  103. <include name="src/**"/>
  104. <include name="conf/**"/>
  105. <include name="docs/**"/>
  106. <include name="hyph/**"/>
  107. <include name="lib/**"/>
  108. <include name="CHANGES"/>
  109. <include name="LICENSE"/>
  110. <include name="README"/>
  111. <include name="STATUS"/>
  112. <include name="build*"/>
  113. <include name="fop.bat"/>
  114. <include name="fop.sh"/>
  115. </fileset>
  116. <path id="libs-run-classpath">
  117. <fileset dir="lib">
  118. <include name="*.jar"/>
  119. </fileset>
  120. <fileset dir="build">
  121. <include name="fop.jar"/>
  122. </fileset>
  123. </path>
  124. <path id="libs-build-classpath">
  125. <fileset dir="lib">
  126. <include name="stylebook*.jar"/>
  127. <include name="xalan*.jar"/>
  128. <include name="xerces*.jar"/>
  129. </fileset>
  130. </path>
  131. <!-- =================================================================== -->
  132. <!-- Initialization target -->
  133. <!-- =================================================================== -->
  134. <target name="init" depends="init-avail, init-filters-xalan2">
  135. <tstamp/>
  136. <property name="Name" value="Fop"/>
  137. <property name="name" value="fop"/>
  138. <property name="version" value="1.0dev"/>
  139. <filter token="version" value="${version}"/>
  140. <property name="year" value="1999-2002"/>
  141. <echo message="------------------- ${Name} ${version} [${year}] ----------------"/>
  142. <property name="build.compiler" value="classic"/>
  143. <property name="debug" value="on"/>
  144. <property name="optimize" value="off"/>
  145. <property name="deprecation" value="off"/>
  146. <property name="src.dir" value="./src"/>
  147. <property name="src.codegen" value="./src/codegen"/>
  148. <property name="docs.dir" value="./docs"/>
  149. <property name="lib.dir" value="./lib"/>
  150. <property name="hyph.dir" value="./hyph"/>
  151. <property name="conf.dir" value="./conf"/>
  152. <property name="packages" value="org.apache.fop.*"/>
  153. <property name="docs" value="docs/html-docs"/>
  154. <property name="xdocs" value="docs/xml-docs"/>
  155. <property name="skins" value="docs/xml-docs/skins/xml.apache.org/"/>
  156. <property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
  157. <property name="doc.generator.package" value="${lib.dir}/stylebook-1.0-b2.jar"/>
  158. <property name="viewer.resources.src.dir" value="./src/org/apache/fop/viewer/resources"/>
  159. <property name="viewer.images.src.dir" value="./src/org/apache/fop/viewer/Images"/>
  160. <property name="build.dir" value="./build"/>
  161. <property name="build.src" value="./build/src"/>
  162. <property name="build.codegen" value="./build/src/codegen"/>
  163. <property name="build.dest" value="./build/classes"/>
  164. <property name="build.docs" value="./build/docs"/>
  165. <property name="build.javadocs" value="./build/javadocs"/>
  166. <property name="viewer.resources.dest.dir" value="${build.dest}/org/apache/fop/viewer/resources"/>
  167. <property name="viewer.images.dest.dir" value="${build.dest}/org/apache/fop/viewer/Images"/>
  168. <!-- <property name="dist.dir" value="./dist"/> -->
  169. <property name="dist.bin.dir" value="./dist-bin"/>
  170. <property name="dist.src.dir" value="./dist-src"/>
  171. <property name="dist.bin.result.dir" value="${dist.bin.dir}/${Name}-${version}"/>
  172. <property name="dist.src.result.dir" value="${dist.src.dir}/${Name}-${version}"/>
  173. <property name="properties.dir" value="org/apache/fop/fo/properties"/>
  174. <property name="fonts.dir" value="org/apache/fop/render/pdf/fonts"/>
  175. <property name="svg.dir" value="org/apache/fop/svg"/>
  176. <property name="replacestring" value="org/apache/fop"/>
  177. <property name="ignore_this" value="ignore_this.java"/>
  178. <property name="jimi" value="JimiImage.java"/>
  179. <property name="jai" value="JAIImage.java"/>
  180. <property name="xslt" value="org.apache.xalan.xslt.Process"/>
  181. <property name="src.properties.xsl" value="${src.codegen}/properties.xsl"/>
  182. <property name="src.propmaker.xsl" value="${src.codegen}/propmaker.xsl"/>
  183. <property name="foproperties.xml" value="${build.codegen}/foproperties.xml"/>
  184. <property name="colorkw.xml" value="${build.codegen}/colorkw.xml"/>
  185. <property name="allprops.xml" value="${build.codegen}/allprops.xml"/>
  186. <property name="properties.xsl" value="${build.codegen}/properties.xsl"/>
  187. <property name="propmap.xsl" value="${build.codegen}/propmap.xsl"/>
  188. <property name="enumgen.xsl" value="${build.codegen}/enumgen.xsl"/>
  189. <property name="propinc.xsl" value="${build.codegen}/propinc.xsl"/>
  190. <property name="genconst.xsl" value="${build.codegen}/genconst.xsl"/>
  191. <property name="src.charlist.xsl" value="${src.codegen}/code-point-mapping.xsl"/>
  192. <property name="charlist.xml" value="${build.codegen}/charlist.xml"/>
  193. <property name="charlist.xsl" value="${build.codegen}/code-point-mapping.xsl"/>
  194. <property name="fontfile.xsl" value="${build.codegen}/font-file.xsl"/>
  195. <property name="t1fontfile.xsl" value="${build.codegen}/t1font-file.xsl"/>
  196. <property name="ttffontfile.xsl" value="${build.codegen}/ttffontfile.xsl"/>
  197. <property name="Courier.xml" value="${build.codegen}/Courier.xml"/>
  198. <property name="Courier-Oblique.xml" value="${build.codegen}/Courier-Oblique.xml"/>
  199. <property name="Courier-Bold.xml" value="${build.codegen}/Courier-Bold.xml"/>
  200. <property name="Courier-BoldOblique.xml" value="${build.codegen}/Courier-BoldOblique.xml"/>
  201. <property name="Helvetica.xml" value="${build.codegen}/Helvetica.xml"/>
  202. <property name="Helvetica-Oblique.xml" value="${build.codegen}/Helvetica-Oblique.xml"/>
  203. <property name="Helvetica-Bold.xml" value="${build.codegen}/Helvetica-Bold.xml"/>
  204. <property name="Helvetica-BoldOblique.xml" value="${build.codegen}/Helvetica-BoldOblique.xml"/>
  205. <property name="Times-Roman.xml" value="${build.codegen}/Times-Roman.xml"/>
  206. <property name="Times-Italic.xml" value="${build.codegen}/Times-Italic.xml"/>
  207. <property name="Times-Bold.xml" value="${build.codegen}/Times-Bold.xml"/>
  208. <property name="Times-BoldItalic.xml" value="${build.codegen}/Times-BoldItalic.xml"/>
  209. <property name="ZapfDingbats.xml" value="${build.codegen}/ZapfDingbats.xml"/>
  210. <property name="Symbol.xml" value="${build.codegen}/Symbol.xml"/>
  211. <property name="trax" value="TraxTransform.java"/>
  212. <property name="xsltransform" value="XSLTransform.java"/>
  213. <property name="tools.pkg" value="org/apache/fop/tools"/>
  214. <!-- insert custom font information here (step 1 of 2) -->
  215. <!-- use this as a template
  216. <property name="myfont.xml" value="${build.codegen}/myfont.xml"/>
  217. -->
  218. <taskdef name="serHyph" classname="org.apache.fop.tools.anttasks.SerializeHyphPattern"/>
  219. <taskdef name="runTest" classname="org.apache.fop.tools.anttasks.RunTest"/>
  220. <property name="main.class" value="org.apache.fop.apps.Fop"/>
  221. <property name="runtime.classpath" value="lib/xerces-1.4.3.jar lib/xalan-2.2D11.jar lib/batik.jar lib/jimi-1.0.jar lib/avalon-framework-cvs-20020315.jar"/>
  222. <filter filtersfile="${build.src}/codegen/filter"/>
  223. </target>
  224. <target name="init-avail">
  225. <available property="jimi.present" classname="com.sun.jimi.core.Jimi"/>
  226. <available property="jai.present" classname="javax.media.jai.JAI"/>
  227. <available property="trax.present" classname="javax.xml.transform.Transformer"/>
  228. <filter token="xalan2-replacestring" value="../../"/>
  229. </target>
  230. <target name="init-filters-xalan2" depends="init-avail" if="trax.present">
  231. <copy file="src/codegen/xalan2.filter" toFile="./build/src/codegen/filter" filtering="on"/>
  232. </target>
  233. <!-- =================================================================== -->
  234. <!-- Help on usage -->
  235. <!-- =================================================================== -->
  236. <target name="usage">
  237. <echo message=""/>
  238. <echo message=""/>
  239. <echo message="${Name} Build file"/>
  240. <echo message="-------------------------------------------------------------"/>
  241. <echo message=""/>
  242. <echo message=" available targets are:"/>
  243. <echo message=""/>
  244. <echo message=" package --> generates the ${name}.jar file (default)"/>
  245. <echo message=" codegen --> generates the java files from the xml resources"/>
  246. <echo message=" compile --> compiles the source code"/>
  247. <echo message=" htmldoc --> generates the HTML documentation"/>
  248. <echo message=" javadocs --> generates the API documentation (java 1.2 only)"/>
  249. <echo message=" pdfdoc --> generates the PDF documentation"/>
  250. <echo message=" dist --> generates the ${Name} distribution as .tar.gz and .zip"/>
  251. <echo message=" clean --> cleans up the directory (except for the dist files)"/>
  252. <echo message=" distclean --> cleans up the directory"/>
  253. <echo message=" site --> generates the ${Name} web site (not yet implemented)"/>
  254. <echo message=""/>
  255. <echo message=" See the comments inside the build.xml file for more details."/>
  256. <echo message="-------------------------------------------------------------"/>
  257. <echo message=""/>
  258. <echo message=""/>
  259. </target>
  260. <!-- =================================================================== -->
  261. <!-- Prepares the build directory -->
  262. <!-- =================================================================== -->
  263. <target name="prepare" depends="init">
  264. <!-- create directories -->
  265. <echo message="Preparing the build directories"/>
  266. <mkdir dir="${build.dir}"/>
  267. <mkdir dir="${build.src}"/>
  268. <mkdir dir="${build.src}/${properties.dir}"/>
  269. <mkdir dir="${build.src}/${fonts.dir}"/>
  270. <mkdir dir="${build.src}/${svg.dir}"/>
  271. <mkdir dir="${build.dest}/conf"/>
  272. <mkdir dir="${build.dest}/hyph"/>
  273. <copy todir="${build.dest}/conf" filtering="yes">
  274. <fileset dir="./conf"/>
  275. </copy>
  276. </target>
  277. <!-- =================================================================== -->
  278. <!-- compiles hyphenation patterns -->
  279. <!-- =================================================================== -->
  280. <target name="hyphenation" depends="prepare" >
  281. <serHyph includes="*.xml"
  282. sourceDir="./hyph"
  283. targetDir="${build.dest}/hyph" />
  284. </target>
  285. <!-- =================================================================== -->
  286. <!-- copies special image class only if Jimi library is present -->
  287. <!-- =================================================================== -->
  288. <target name="prepare-jimi" depends="prepare" if="jimi.present">
  289. <echo message="Jimi library is present. Fop installs jimi support."/>
  290. <copy todir="${build.src}">
  291. <fileset dir="${src.dir}" includes="**/${jimi}"/>
  292. </copy>
  293. </target>
  294. <!-- =================================================================== -->
  295. <!-- copies special image class only if JAI library is present -->
  296. <!-- =================================================================== -->
  297. <target name="prepare-jai" depends="prepare" if="jai.present">
  298. <echo message="JAI library is present. Fop installs JAI support."/>
  299. <copy todir="${build.src}">
  300. <fileset dir="${src.dir}" includes="**/${jai}"/>
  301. </copy>
  302. </target>
  303. <target name="prepare-trax" if="trax.present">
  304. <echo message="JAXP1.1 transforms is present. Installing TRaX support"/>
  305. <copy todir="${build.src}">
  306. <fileset dir="${src.dir}" includes="**/${xsltransform},**/${trax},**/apps/TraxInputHandler.java"/>
  307. </copy>
  308. </target>
  309. <!-- =================================================================== -->
  310. <!-- Prepares the source code -->
  311. <!-- =================================================================== -->
  312. <target name="prepare-src" depends="prepare, prepare-jimi, prepare-jai, prepare-trax">
  313. <!-- copy src files -->
  314. <copy todir="${build.src}">
  315. <fileset dir="${src.dir}"
  316. excludes="**/Makefile*, **/package.html, **/${jimi},**/${jai},**/${xsltransform},**/${trax},**/apps/TraxInputHandler.java"/>
  317. </copy>
  318. </target>
  319. <!-- =================================================================== -->
  320. <!-- Generate the source code -->
  321. <!-- =================================================================== -->
  322. <target name="codegen" depends="prepare">
  323. <!-- resetting codegen directory -->
  324. <echo message="Resetting codegen directory"/>
  325. <!-- copy codegen directory -->
  326. <copy todir="${build.codegen}" filtering="on">
  327. <fileset dir="${src.codegen}"/>
  328. </copy>
  329. <!-- generate the java files from xml resources -->
  330. <echo message="Generating the java files from xml resources"/>
  331. <dependset>
  332. <srcfilelist dir="./" files="${foproperties.xml},${colorkw.xml}"/>
  333. <targetfilelist dir="./" files="${build.src}/${replacestring}/fo/properties/Constants.java,${build.src}/${replacestring}/fo/properties/fo_${ignore_this}"/>
  334. </dependset>
  335. <dependset>
  336. <srcfilelist dir="./" files="${propinc.xsl}"/>
  337. <targetfilelist dir="./" files="${build.src}/${replacestring}/fo/properties/fo_${ignore_this},${build.src}/${replacestring}/fo/properties/FOPropertyMapping.java,${build.src}/${replacestring}/fo/properties/foenums_${ignore_this}"/>
  338. </dependset>
  339. <style in="${allprops.xml}" style="${genconst.xsl}"
  340. out="${build.src}/${replacestring}/fo/properties/Constants.java"/>
  341. <style in="${foproperties.xml}" style="${properties.xsl}"
  342. out="${build.src}/${replacestring}/fo/properties/fo_${ignore_this}"/>
  343. <style in="${foproperties.xml}" style="${propmap.xsl}"
  344. out="${build.src}/${replacestring}/fo/properties/FOPropertyMapping.java"/>
  345. <style in="${foproperties.xml}" style="${enumgen.xsl}"
  346. out="${build.src}/${replacestring}/fo/properties/foenums_${ignore_this}"/>
  347. <style in="${charlist.xml}" style="${charlist.xsl}"
  348. out="${build.src}/${replacestring}/render/pdf/CodePointMapping.java"/>
  349. <style basedir="src/codegen" includes="*.xml"
  350. excludes="allprops.xml,charlist.xml,colorkw.xml,*prop*" style="${fontfile.xsl}"
  351. destdir="${build.src}/${replacestring}/render/pdf/fonts/" extension=".java"/>
  352. <!-- custom fonts (Use t1fontfile.xsl instead of fontfile.xsl for Type 1 fonts!) step 2/2 -->
  353. <!-- use this as a template for type 1 fonts:
  354. <style in="${myfont.xml}" style="${t1fontfile.xsl}"
  355. out="${build.src}/${replacestring}/render/pdf/fonts/myfont.java"/>
  356. -->
  357. <!-- use this as a template for truetype fonts
  358. <style in="${myfont.xml}" style="${ttffontfile.xsl}"
  359. out="${build.src}/${replacestring}/render/pdf/fonts/myfont.java"/>
  360. -->
  361. </target>
  362. <!-- =================================================================== -->
  363. <!-- Compiles the source directory -->
  364. <!-- =================================================================== -->
  365. <target name="compile" depends="codegen, prepare-src">
  366. <echo message="Compiling the sources "/>
  367. <!-- create directories -->
  368. <mkdir dir="${build.dest}"/>
  369. <mkdir dir="${viewer.resources.dest.dir}"/>
  370. <copy todir="${viewer.resources.dest.dir}">
  371. <fileset dir="${viewer.resources.src.dir}"/>
  372. </copy>
  373. <mkdir dir="${viewer.images.dest.dir}"/>
  374. <copy todir="${viewer.images.dest.dir}">
  375. <fileset dir="${viewer.images.src.dir}"/>
  376. </copy>
  377. <javac srcdir="${build.src}"
  378. destdir="${build.dest}"
  379. debug="${debug}"
  380. deprecation="${deprecation}"
  381. optimize="${optimize}"
  382. excludes="**/*${ignore_this},${jimi}"/>
  383. </target>
  384. <!-- =================================================================== -->
  385. <!-- Creates the class package -->
  386. <!-- =================================================================== -->
  387. <target name="package" depends="compile,hyphenation">
  388. <echo message="Creating the jar file ${build.dir}/${name}.jar"/>
  389. <tstamp>
  390. <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
  391. </tstamp>
  392. <jar jarfile="${build.dir}/${name}.jar"
  393. basedir="${build.dest}"
  394. includes="org/**,conf/**,hyph/**">
  395. <manifest>
  396. <attribute name="Main-Class" value="${main.class}"/>
  397. <attribute name="Class-Path" value="${runtime.classpath}"/>
  398. <attribute name="Implementation-Title" value="${Name}"/>
  399. <attribute name="Implementation-Version" value="${version}"/>
  400. <attribute name="Implementation-Vendor" value="Apache Software Foundation (http://xml.apache.org/fop/)"/>
  401. <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}])"/>
  402. </manifest>
  403. </jar>
  404. </target>
  405. <target name="test" depends="package">
  406. <echo message="Testing build in jar file ${build.dir}/${name}.jar against reference"/>
  407. <runTest testSuite="basictests.xml" basedir="test/" reference="test/reference/fop.jar"
  408. refVersion="FOP 1.0dev"/>
  409. <runTest testSuite="bugtests.xml" basedir="test/" reference="test/reference/fop.jar"
  410. refVersion="FOP 1.0dev"/>
  411. <!--
  412. <runTest testSuite="testsuite.xml" basedir="TestSuite/NIST/" reference="test/reference/fop.jar"
  413. refVersion="FOP 1.0dev"/>
  414. <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/IBM/" reference="test/reference/fop.jar"
  415. refVersion="FOP 1.0dev"/>
  416. <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/FOP/" reference="test/reference/fop.jar"
  417. refVersion="FOP 1.0dev"/>
  418. <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/XEP/" reference="test/reference/fop.jar"
  419. refVersion="FOP 1.0dev"/>
  420. <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/XSLFormatter/" reference="test/reference/fop.jar"
  421. refVersion="FOP 1.0dev"/>
  422. -->
  423. </target>
  424. <target name="all" depends="package"/> <!-- "all" target for us Makefile converts ;-) -->
  425. <!-- =================================================================== -->
  426. <!-- Prepares the docs -->
  427. <!-- =================================================================== -->
  428. <target name="prepare-docs" depends="init">
  429. <mkdir dir="${build.docs}"/>
  430. <!-- sets exec permission for antRun on Unix systems. necessary for javadoc-->
  431. <chmod file="${lib.dir}/bin/antRun" perm="ugo+rx" />
  432. </target>
  433. <!-- =================================================================== -->
  434. <!-- Creates the API documentation -->
  435. <!-- =================================================================== -->
  436. <target name="javadocs" depends="prepare-src">
  437. <echo message="Producing the javadoc files "/>
  438. <mkdir dir="${build.javadocs}"/>
  439. <javadoc packagenames="${packages}"
  440. sourcepath="${build.src}"
  441. destdir="${build.javadocs}"
  442. author="true"
  443. version="true"
  444. windowtitle="${Name} API"
  445. doctitle="${Name}"
  446. bottom="Copyright &#169; ${year} Apache Software Foundation. All Rights Reserved."
  447. />
  448. </target>
  449. <target name="html" depends="javadocs, htmldoc"/>
  450. <target name="htmldoc" depends= "html-fop, html-design"/>
  451. <target name="html-fop" depends="prepare-src">
  452. <copy file="${xdocs}/fop.xml"
  453. tofile="${xdocs}/book.xml"
  454. filtering="on"/>
  455. <java classname="${doc.generator}" fork="yes">
  456. <classpath refid="libs-build-classpath"/>
  457. <arg line="targetDirectory=${docs} ${xdocs}/book.xml ${skins}"/>
  458. </java>
  459. </target>
  460. <target name="html-design" depends="prepare-src, html-newdesign,
  461. html-altdesign, html-understanding"/>
  462. <target name="html-newdesign" depends="prepare-src">
  463. <java classname="${doc.generator}" fork="yes">
  464. <classpath refid="libs-build-classpath"/>
  465. <arg line="targetDirectory=${docs}/design/ docs/design/book.xml ${skins}"/>
  466. </java>
  467. </target>
  468. <target name="html-altdesign" depends="prepare-src">
  469. <java classname="${doc.generator}" fork="yes">
  470. <classpath refid="libs-build-classpath"/>
  471. <arg line="targetDirectory=${docs}/design/alt.design/ docs/design/alt.design/book.xml ${skins}"/>
  472. </java>
  473. </target>
  474. <target name="html-understanding" depends="prepare-src">
  475. <java classname="${doc.generator}" fork="yes">
  476. <classpath refid="libs-build-classpath"/>
  477. <arg line="targetDirectory=${docs}/design/understanding docs/design/understanding/book.xml ${skins}"/>
  478. </java>
  479. </target>
  480. <target name="pdfdoc" depends="package">
  481. <copy file="${xdocs}/fop.xml"
  482. tofile="${xdocs}/book.xml"
  483. filtering="on"/>
  484. <style in="${xdocs}/fop.xml" style="${xdocs}/xml2xml.xsl" out="${xdocs}/fop-doc.xml"/>
  485. <style in="${xdocs}/fop-doc.xml" style="${xdocs}/xml2pdf.xsl" out="${xdocs}/fop.fo"/>
  486. <java classname="org.apache.fop.apps.Fop" fork="yes">
  487. <classpath refid="libs-run-classpath"/>
  488. <arg line="-fo ${xdocs}/fop.fo -pdf ${xdocs}/fop.pdf"/>
  489. </java>
  490. </target>
  491. <!-- =================================================================== -->
  492. <!-- Creates the distribution -->
  493. <!-- =================================================================== -->
  494. <target name="dist" depends="dist-src,dist-bin"/>
  495. <target name="dist-bin" depends="package">
  496. <echo message="Building the binary distribution files (zip,tar)"/>
  497. <mkdir dir="${dist.bin.result.dir}"/>
  498. <copy todir="${dist.bin.result.dir}">
  499. <fileset refid="dist.bin"/>
  500. <fileset refid="dist.bin.lib"/>
  501. </copy>
  502. <mkdir dir="${dist.bin.result.dir}/build"/>
  503. <copy todir="${dist.bin.result.dir}/build" file="build/fop.jar"/>
  504. <chmod file="${dist.bin.result.dir}/fop.sh" perm="ugo+rx" />
  505. <zip zipfile="${Name}-${version}-bin.zip" basedir="${dist.bin.dir}" includes="**"/>
  506. <tar tarfile="${Name}-${version}-bin.tar" basedir="${dist.bin.dir}" includes="**"/>
  507. <gzip zipfile="${Name}-${version}-bin.tar.gz" src="${Name}-${version}-bin.tar" />
  508. <delete file="${Name}-${version}-bin.tar"/>
  509. </target>
  510. <target name="dist-src" depends="package, javadocs">
  511. <echo message="Building the source distribution files (zip,tar)"/>
  512. <mkdir dir="${dist.src.result.dir}"/>
  513. <copy todir="${dist.src.result.dir}">
  514. <fileset refid="dist.src"/>
  515. </copy>
  516. <copy todir="${dist.src.result.dir}/javadocs">
  517. <fileset dir="${build.javadocs}"/>
  518. </copy>
  519. <mkdir dir="${dist.src.result.dir}/build"/>
  520. <copy todir="${dist.src.result.dir}/build" file="build/fop.jar"/>
  521. <chmod file="${dist.src.result.dir}/build.sh" perm="ugo+rx" />
  522. <chmod file="${dist.src.result.dir}/fop.sh" perm="ugo+rx" />
  523. <zip zipfile="${Name}-${version}-src.zip" basedir="${dist.src.dir}" includes="**"/>
  524. <tar tarfile="${Name}-${version}-src.tar" basedir="${dist.src.dir}" includes="**"/>
  525. <gzip zipfile="${Name}-${version}-src.tar.gz" src="${Name}-${version}-src.tar" />
  526. <delete file="${Name}-${version}-src.tar"/>
  527. </target>
  528. <!-- =================================================================== -->
  529. <!-- Clean targets -->
  530. <!-- =================================================================== -->
  531. <target name="clean" depends="init">
  532. <delete dir="${build.dir}"/>
  533. </target>
  534. <target name="distclean" depends="clean">
  535. <delete dir="${dist.src.dir}"/>
  536. <delete dir="${dist.bin.dir}"/>
  537. <delete>
  538. <fileset dir="${basedir}" includes="${Name}-*.tar.gz"/>
  539. <fileset dir="${basedir}" includes="${Name}-*.zip"/>
  540. </delete>
  541. </target>
  542. </project>