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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <?xml version="1.0"?>
  2. <!-- ===========================================================================
  3. * ================== *
  4. | FOP build system |
  5. * ================== *
  6. Building instructions
  7. =====================
  8. First, change directory to where this file is located. Then type
  9. ./build.sh (on unixes)
  10. build (on Windows)
  11. If everything is right and all the required packages are visible, this action
  12. will generate a file called "fop.jar" in the "./build" directory.
  13. If you experience any problems with the build please visit the FOP website for
  14. more information: http://xml.apache.org/fop
  15. Build targets
  16. =============
  17. The build system is not only responsible for compiling Fop into a jar file,
  18. but also for creating the HTML documentation, javadocs,
  19. distributions and web site. In fact, the file you have here is _exactly_ what
  20. is used by fop maintainers to take care of everything in the Fop
  21. project.
  22. Call the build script (see above) with the parameter "-projecthelp" to get a
  23. list of possible build targets.
  24. ============================================================================ -->
  25. <project default="all" basedir=".">
  26. <!-- used to set values for testing etc. -->
  27. <!-- build-local.properties is not stored in CVS and overrides values from build.properties -->
  28. <property file="build-local.properties"/>
  29. <property file="build.properties"/>
  30. <fileset dir="${basedir}" id="dist.bin">
  31. <include name="conf/**"/>
  32. <include name="docs/**"/>
  33. <include name="CHANGES"/>
  34. <include name="LICENSE"/>
  35. <include name="README"/>
  36. <include name="STATUS"/>
  37. <include name="fop.bat"/>
  38. <include name="fop.sh"/>
  39. <exclude name="src/**"/>
  40. <exclude name="dist/**"/>
  41. <exclude name="build/**"/>
  42. <exclude name="lib/**"/>
  43. </fileset>
  44. <fileset dir="${basedir}" id="dist.bin.lib">
  45. <include name="lib/xercesImpl-2.2.1.jar"/>
  46. <include name="lib/xalan-2.4.1.jar"/>
  47. <include name="lib/xml-apis.jar"/>
  48. </fileset>
  49. <fileset dir="${basedir}" id="dist.src">
  50. <exclude name="lib/classes/**"/>
  51. <exclude name="lib/org/**"/>
  52. <exclude name="lib/src/**"/>
  53. <exclude name="build/**"/>
  54. <include name="src/**"/>
  55. <include name="conf/**"/>
  56. <include name="docs/**"/>
  57. <include name="lib/**"/>
  58. <include name="CHANGES"/>
  59. <include name="LICENSE"/>
  60. <include name="README"/>
  61. <include name="STATUS"/>
  62. <include name="build*"/>
  63. <include name="fop.bat"/>
  64. <include name="fop.sh"/>
  65. </fileset>
  66. <path id="libs-build-classpath">
  67. <fileset dir="lib">
  68. <include name="*.jar"/>
  69. </fileset>
  70. </path>
  71. <path id="libs-run-classpath">
  72. <fileset dir="lib">
  73. <include name="*.jar"/>
  74. <exclude name="ant.jar"/>
  75. </fileset>
  76. <fileset dir="build">
  77. <include name="fop.jar"/>
  78. </fileset>
  79. </path>
  80. <path id="checkstylepath">
  81. <fileset dir="lib">
  82. <include name="checkstyle-all-*.jar"/>
  83. </fileset>
  84. </path>
  85. <patternset id="base-sources">
  86. <include name="**/*.java"/>
  87. <exclude name="**/*${ignore_this}"/>
  88. </patternset>
  89. <!-- =================================================================== -->
  90. <!-- Pre-initialization target -->
  91. <!-- =================================================================== -->
  92. <target name="pre-init">
  93. <tstamp/>
  94. <!-- Set up initial required properties -->
  95. <property name="Name" value="Fop"/>
  96. <property name="name" value="fop"/>
  97. <property name="NAME" value="FOP"/>
  98. <property name="year" value="1999-2003"/>
  99. <!-- Compilation parameters -->
  100. <property name="debug" value="on"/>
  101. <property name="optimize" value="off"/>
  102. <property name="deprecation" value="on"/>
  103. <!-- Source and library directories -->
  104. <property name="src.dir" value="${basedir}/src"/>
  105. <!-- <property name="src.java" value="${src.dir}/java"/> -->
  106. <property name="src.java" value="${src.dir}"/>
  107. <property name="src.codegen" value="${src.dir}/codegen"/>
  108. <property name="lib.dir" value="${basedir}/lib"/>
  109. <property name="hyph.dir" value="${src.dir}/hyph"/>
  110. <property name="conf.dir" value="${basedir}/conf"/>
  111. <property name="fo.examples.dir" value="${basedir}/examples/fo/basic"/>
  112. <!-- Properties for derivation of Version information -->
  113. <property name="fop.dir" value="org/apache/fop"/>
  114. <property name="version.dir" value="${fop.dir}/version"/>
  115. <property name="version.src.java" value="${src.java}/${version.dir}"/>
  116. <property name="packages" value="org.apache.fop.*"/>
  117. <property name="fop.prefix" value="org.apache.fop"/>
  118. <property name="version.prefix" value="${fop.prefix}.version"/>
  119. <!-- Build directories -->
  120. <property name="build.dir" value="${basedir}/build"/>
  121. <property name="build.dest" value="${build.dir}/classes"/>
  122. <property name="build.tmp" value="${build.dir}/tmp"/>
  123. <property name="build.src" value="${build.dir}/src"/>
  124. <property name="build.gensrc" value="${build.dir}/gensrc"/>
  125. <property name="build.docsrc" value="${build.dir}/docsrc"/>
  126. <property name="build.codegen" value="${build.src}/codegen"/>
  127. <property name="build.javadocs" value="${build.dir}/javadocs"/>
  128. <property name="build.examples.dir" value="${build.dir}/examples"/>
  129. </target>
  130. <!-- =================================================================== -->
  131. <!-- Generate the build version properties -->
  132. <!-- =================================================================== -->
  133. <target name="version" depends="pre-init">
  134. <!-- create directories -->
  135. <echo message="Preparing the build directories"/>
  136. <mkdir dir="${build.dir}"/>
  137. <mkdir dir="${build.dest}"/>
  138. <mkdir dir="${build.tmp}"/>
  139. <!-- Compile Version.java if necessary -->
  140. <echo message="Check for current Version class file."/>
  141. <property name="tmp.version.file" value="${build.tmp}/version.property"/>
  142. <javac srcdir="${version.src.java}" destdir="${build.dest}"
  143. debug="${debug}" deprecation="${deprecation}"
  144. optimize="${optimize}"/>
  145. <!-- Run Version.class and capture output, which defines properties
  146. "build.description" and "build.tag"
  147. or "build.default.description" and "build.default.tag". -->
  148. <java classname="org.apache.fop.version.Version"
  149. failonerror="true" output="${tmp.version.file}">
  150. <classpath location="${build.dest}"/>
  151. </java>
  152. <!-- Set the properties from the temporary output file -->
  153. <property file="${tmp.version.file}"/>
  154. <!-- Test the setting of the properties -->
  155. <!-- For full distributions, this test could be used to trigger a
  156. CVS checkout of a tag defined in build-local.properties
  157. Final propertes are:
  158. build.display.name - the formatted Tag value
  159. build.tag.name - the unformatted Tag value
  160. -->
  161. <condition property="build.display.name" value="${build.description}">
  162. <isset property="build.description"/>
  163. </condition>
  164. <condition property="build.tag.name" value="${build.tag}">
  165. <isset property="build.tag"/>
  166. </condition>
  167. <condition property="build.display.name" value="${build.default.description}">
  168. <isset property="build.default.description"/>
  169. </condition>
  170. <condition property="build.tag.name" value="${build.default.tag}">
  171. <isset property="build.default.tag"/>
  172. </condition>
  173. <echo message="------------------- ${build.display.name} [${year}] ----------------"/>
  174. <echo message="See build.properties and build-local.properties for additional build settings"/>
  175. </target>
  176. <!-- =================================================================== -->
  177. <!-- Post-initialization target -->
  178. <!-- =================================================================== -->
  179. <target name="post-init" depends="pre-init, version">
  180. <property name="textfontencoding" value="WinAnsiEncoding"/>
  181. <property name="dist.bin.dir" value="${basedir}/dist-bin"/>
  182. <property name="dist.src.dir" value="${basedir}/dist-src"/>
  183. <property name="dist.bin.result.dir"
  184. value="${dist.bin.dir}/${build.tag.name}"/>
  185. <property name="dist.src.result.dir"
  186. value="${dist.src.dir}/${build.tag.name}"/>
  187. <property name="fonts.dir" value="org/apache/fop/fonts/base14"/>
  188. <property name="ignore_this" value="ignore_this.dummy"/>
  189. <property name="jimi" value="JimiImage.java"/>
  190. <property name="jai" value="JAIImage.java"/>
  191. <property name="xslt" value="org.apache.xalan.xslt.Process"/>
  192. <property name="encodings.xml" value="${build.codegen}/encodings.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}/CourierOblique.xml"/>
  199. <property name="Courier-Bold.xml" value="${build.codegen}/CourierBold.xml"/>
  200. <property name="Courier-BoldOblique.xml" value="${build.codegen}/CourierBoldOblique.xml"/>
  201. <property name="Helvetica.xml" value="${build.codegen}/Helvetica.xml"/>
  202. <property name="Helvetica-Oblique.xml" value="${build.codegen}/HelveticaOblique.xml"/>
  203. <property name="Helvetica-Bold.xml" value="${build.codegen}/HelveticaBold.xml"/>
  204. <property name="Helvetica-BoldOblique.xml" value="${build.codegen}/HelveticaBoldOblique.xml"/>
  205. <property name="Times-Roman.xml" value="${build.codegen}/TimesRoman.xml"/>
  206. <property name="Times-Italic.xml" value="${build.codegen}/TimesItalic.xml"/>
  207. <property name="Times-Bold.xml" value="${build.codegen}/TimesBold.xml"/>
  208. <property name="Times-BoldItalic.xml" value="${build.codegen}/TimesBoldItalic.xml"/>
  209. <property name="ZapfDingbats.xml" value="${build.codegen}/ZapfDingbats.xml"/>
  210. <property name="Symbol.xml" value="${build.codegen}/Symbol.xml"/>
  211. <property name="tools.pkg" value="org/apache/fop/tools"/>
  212. <property name="main.class" value="org.apache.fop.apps.Fop"/>
  213. </target>
  214. <!-- =================================================================== -->
  215. <!-- Initialization target -->
  216. <!-- =================================================================== -->
  217. <target name="init" depends="pre-init, version, post-init">
  218. </target>
  219. <!-- =================================================================== -->
  220. <!-- Help on usage -->
  221. <!-- =================================================================== -->
  222. <target name="usage">
  223. <echo message="Use the -projecthelp option instead"/>
  224. </target>
  225. <!-- =================================================================== -->
  226. <!-- Prepares the build directory -->
  227. <!-- =================================================================== -->
  228. <target name="prepare" depends="init">
  229. <!-- create remaining directories
  230. Note that some directories have been created by the 'version' target.
  231. -->
  232. <echo message="Preparing the build directories"/>
  233. <mkdir dir="${build.src}"/>
  234. <mkdir dir="${build.gensrc}"/>
  235. <mkdir dir="${build.gensrc}/${properties.dir}"/>
  236. <mkdir dir="${build.gensrc}/${fonts.dir}"/>
  237. </target>
  238. <!-- =================================================================== -->
  239. <!-- Generate the source code -->
  240. <!-- =================================================================== -->
  241. <target name="codegen" depends="prepare" description="Generates the java files from the xml resources">
  242. <!-- resetting codegen directory -->
  243. <echo message="Resetting codegen directory"/>
  244. <!-- copy codegen directory -->
  245. <copy todir="${build.codegen}">
  246. <fileset dir="${src.codegen}"/>
  247. </copy>
  248. <!-- generate the java files from xml resources -->
  249. <echo message="Generating the java files from xml resources"/>
  250. <style in="${encodings.xml}" style="${charlist.xsl}"
  251. out="${build.gensrc}/${fop.dir}/fonts//CodePointMapping.java"/>
  252. <style in="${Courier.xml}" style="${fontfile.xsl}"
  253. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  254. out="${build.gensrc}/${fop.dir}/fonts/base14/Courier.java">
  255. <param name="encoding" expression="${textfontencoding}"/>
  256. </style>
  257. <style in="${Courier-Oblique.xml}" style="${fontfile.xsl}"
  258. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  259. out="${build.gensrc}/${fop.dir}/fonts/base14/CourierOblique.java">
  260. <param name="encoding" expression="${textfontencoding}"/>
  261. </style>
  262. <style in="${Courier-Bold.xml}" style="${fontfile.xsl}"
  263. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  264. out="${build.gensrc}/${fop.dir}/fonts/base14/CourierBold.java">
  265. <param name="encoding" expression="${textfontencoding}"/>
  266. </style>
  267. <style in="${Courier-BoldOblique.xml}" style="${fontfile.xsl}"
  268. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  269. out="${build.gensrc}/${fop.dir}/fonts/base14/CourierBoldOblique.java">
  270. <param name="encoding" expression="${textfontencoding}"/>
  271. </style>
  272. <style in="${Helvetica.xml}" style="${fontfile.xsl}"
  273. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  274. out="${build.gensrc}/${fop.dir}/fonts/base14/Helvetica.java">
  275. <param name="encoding" expression="${textfontencoding}"/>
  276. </style>
  277. <style in="${Helvetica-Bold.xml}" style="${fontfile.xsl}"
  278. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  279. out="${build.gensrc}/${fop.dir}/fonts/base14/HelveticaBold.java">
  280. <param name="encoding" expression="${textfontencoding}"/>
  281. </style>
  282. <style in="${Helvetica-Oblique.xml}" style="${fontfile.xsl}"
  283. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  284. out="${build.gensrc}/${fop.dir}/fonts/base14/HelveticaOblique.java">
  285. <param name="encoding" expression="${textfontencoding}"/>
  286. </style>
  287. <style in="${Helvetica-BoldOblique.xml}" style="${fontfile.xsl}"
  288. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  289. out="${build.gensrc}/${fop.dir}/fonts/base14/HelveticaBoldOblique.java">
  290. <param name="encoding" expression="${textfontencoding}"/>
  291. </style>
  292. <style in="${Times-Roman.xml}" style="${fontfile.xsl}"
  293. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  294. out="${build.gensrc}/${fop.dir}/fonts/base14/TimesRoman.java">
  295. <param name="encoding" expression="${textfontencoding}"/>
  296. </style>
  297. <style in="${Times-Italic.xml}" style="${fontfile.xsl}"
  298. destdir="${build.gensrc}/${fop.dir}/fonts/base14"
  299. out="${build.gensrc}/${fop.dir}/fonts/base14/TimesItalic.java">
  300. <param name="encoding" expression="${textfontencoding}"/>
  301. </style>
  302. <style in="${Times-Bold.xml}" style="${fontfile.xsl}"
  303. out="${build.gensrc}/${fop.dir}/fonts/base14/TimesBold.java">
  304. <param name="encoding" expression="${textfontencoding}"/>
  305. </style>
  306. <style in="${Times-BoldItalic.xml}" style="${fontfile.xsl}"
  307. out="${build.gensrc}/${fop.dir}/fonts/base14/TimesBoldItalic.java">
  308. <param name="encoding" expression="${textfontencoding}"/>
  309. </style>
  310. <style in="${Symbol.xml}" style="${fontfile.xsl}"
  311. out="${build.gensrc}/${fop.dir}/fonts/base14/Symbol.java"/>
  312. <style in="${ZapfDingbats.xml}" style="${fontfile.xsl}"
  313. out="${build.gensrc}/${fop.dir}/fonts/base14/ZapfDingbats.java"/>
  314. </target>
  315. <!-- =================================================================== -->
  316. <!-- Compiles the source directory -->
  317. <!-- =================================================================== -->
  318. <target name="compile-src" depends="codegen, prepare">
  319. <echo message="Compiling the sources "/>
  320. <!-- create directories -->
  321. <mkdir dir="${build.dest}"/>
  322. <mkdir dir="${viewer.resources.dest.dir}"/>
  323. <copy todir="${viewer.resources.dest.dir}">
  324. <fileset dir="${viewer.resources.src.dir}"/>
  325. </copy>
  326. <mkdir dir="${viewer.images.dest.dir}"/>
  327. <copy todir="${viewer.images.dest.dir}">
  328. <fileset dir="${viewer.images.src.dir}"/>
  329. </copy>
  330. <javac destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}">
  331. <src path="${build.gensrc}"/>
  332. <src path="${src.java}"/>
  333. <patternset refid="exclude-jce-dependencies"/>
  334. <patternset refid="exclude-jai"/>
  335. <patternset refid="exclude-jimi"/>
  336. <classpath refid="libs-build-classpath"/>
  337. <patternset refid="base-sources"/>
  338. </javac>
  339. </target>
  340. <target name="compile" depends="compile-src" description="Compiles the source code"/>
  341. <!-- =================================================================== -->
  342. <!-- Creates the class package -->
  343. <!-- =================================================================== -->
  344. <target name="package" depends="compile" description="Generates the jar files">
  345. <echo message="Creating the jar file ${build.dir}/${name}.jar"/>
  346. <tstamp>
  347. <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
  348. </tstamp>
  349. <pathconvert property="manifest-classpath" dirsep="/" pathsep=" " refid="libs-run-classpath">
  350. <map from="${basedir}${file.separator}lib${file.separator}" to=""/>
  351. <map from="${basedir}${file.separator}build${file.separator}fop.jar" to=""/>
  352. </pathconvert>
  353. <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}" includes="org/**">
  354. <manifest>
  355. <attribute name="Main-Class" value="${main.class}"/>
  356. <attribute name="Class-Path" value="${manifest-classpath}"/>
  357. <attribute name="Implementation-Title" value="${Name}"/>
  358. <attribute name="Implementation-Version" value="${build.display.name}"/>
  359. <attribute name="Implementation-Vendor" value="Apache Software Foundation (http://xml.apache.org/fop/)"/>
  360. <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
  361. </manifest>
  362. </jar>
  363. </target>
  364. <target name="all" depends="package"/> <!-- "all" target for us Makefile converts ;-) -->
  365. <!-- =================================================================== -->
  366. <!-- Prepares the docs -->
  367. <!-- =================================================================== -->
  368. <target name="prepare-docs" depends="init">
  369. <mkdir dir="${build.docs}"/>
  370. </target>
  371. <!-- =================================================================== -->
  372. <!-- Creates the API documentation -->
  373. <!-- =================================================================== -->
  374. <target name="javadocs" depends="prepare" description="Generates javadocs">
  375. <echo message="Producing the javadoc files "/>
  376. <mkdir dir="${build.javadocs}"/>
  377. <javadoc
  378. packagenames="${packages}"
  379. destdir="${build.javadocs}"
  380. classpathref="libs-build-classpath"
  381. author="true"
  382. version="true"
  383. windowtitle="${NAME} API"
  384. doctitle="Formatting Objects Processor (FOP)"
  385. bottom="Copyright &#169; ${year} Apache Software Foundation. All Rights Reserved."
  386. overview="${src.dir}/java/org/apache/fop/overview.html"
  387. use="true"
  388. failonerror="true">
  389. <sourcepath>
  390. <pathelement path="${src.java}"/>
  391. <pathelement path="${build.gensrc}"/>
  392. </sourcepath>
  393. <group title="Control and Startup">
  394. <package name="org.apache.fop.apps"/>
  395. <package name="org.apache.fop.configuration"/>
  396. <package name="org.apache.fop.messaging"/>
  397. <package name="org.apache.fop.servlet"/>
  398. </group>
  399. <group title="XSL-FO Tree">
  400. <package name="org.apache.fop.fo"/>
  401. <package name="org.apache.fop.fo.*"/>
  402. <package name="org.apache.fop.datatypes"/>
  403. <package name="org.apache.fop.extensions"/>
  404. </group>
  405. <group title="Layout">
  406. <package name="org.apache.fop.layoutmgr"/>
  407. <package name="org.apache.fop.layoutmgr.*"/>
  408. <package name="org.apache.fop.layout"/>
  409. <package name="org.apache.fop.layout.*"/>
  410. </group>
  411. <group title="Area Tree">
  412. <package name="org.apache.fop.area"/>
  413. <package name="org.apache.fop.area.*"/>
  414. </group>
  415. <group title="Paginated Rendering">
  416. <package name="org.apache.fop.render"/>
  417. <package name="org.apache.fop.render.*"/>
  418. <package name="org.apache.fop.viewer"/>
  419. </group>
  420. <group title="Structural Rendering">
  421. <package name="org.apache.fop.rtf.renderer"/>
  422. </group>
  423. <group title="Utility">
  424. <package name="org.apache.fop.pdf"/>
  425. <package name="org.apache.fop.mif"/>
  426. <package name="org.apache.fop.tools"/>
  427. <package name="org.apache.fop.tools.*"/>
  428. <package name="org.apache.fop.svg"/>
  429. <package name="org.apache.fop.image"/>
  430. <package name="org.apache.fop.image.*"/>
  431. <package name="org.apache.fop.fonts"/>
  432. <package name="org.apache.fop.fonts.*"/>
  433. <package name="org.apache.fop.util"/>
  434. </group>
  435. </javadoc>
  436. </target>
  437. <!-- =================================================================== -->
  438. <!-- Checkstyle -->
  439. <!-- =================================================================== -->
  440. <target name="checkstyle" depends="prepare" description="Runs Checkstyle for a code quality report">
  441. <available property="checkstyle.available" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstylepath"/>
  442. <fail message="Please put checkstyle-all-*.jar in the lib directory. Get it from http://checkstyle.sourceforge.net" unless="checkstyle.available"/>
  443. <taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstylepath"/>
  444. <checkstyle properties="checkstyle.cfg" failonviolation="false">
  445. <fileset dir="${src.java}" includes="org/apache/fop/**/*.java"/>
  446. <formatter type="plain" toFile="${build.dir}/checkstyle_report.txt"/>
  447. <formatter type="xml" toFile="${build.dir}/checkstyle_report.xml"/>
  448. </checkstyle>
  449. <available property="checkstyle.stylesheet.available" file="checkstyle-noframes.xsl"/>
  450. <antcall target="checkstyle-html"/>
  451. </target>
  452. <target name="checkstyle-html" if="checkstyle.stylesheet.available">
  453. <style in="${build.dir}/checkstyle_report.xml" out="${build.dir}/checkstyle_report.html" style="checkstyle-noframes.xsl"/>
  454. </target>
  455. <!-- =================================================================== -->
  456. <!-- Creates the distribution -->
  457. <!-- =================================================================== -->
  458. <target name="dist" depends="dist-src,dist-bin" description="Generates the distribution package"/>
  459. <target name="dist-bin" depends="all">
  460. <echo message="Building the binary distribution files (zip,tar)"/>
  461. <mkdir dir="${dist.bin.result.dir}"/>
  462. <copy todir="${dist.bin.result.dir}">
  463. <fileset refid="dist.bin"/>
  464. <fileset refid="dist.bin.lib"/>
  465. </copy>
  466. <mkdir dir="${dist.bin.result.dir}/build"/>
  467. <copy todir="${dist.bin.result.dir}/build" file="build/fop.jar"/>
  468. <chmod file="${dist.bin.result.dir}/fop.sh" perm="ugo+rx"/>
  469. <zip zipfile="${Name}-${version}-bin.zip" basedir="${dist.bin.dir}" includes="**"/>
  470. <tar tarfile="${Name}-${version}-bin.tar" basedir="${dist.bin.dir}" includes="**"/>
  471. <gzip zipfile="${Name}-${version}-bin.tar.gz" src="${Name}-${version}-bin.tar"/>
  472. <delete file="${Name}-${version}-bin.tar"/>
  473. </target>
  474. <target name="dist-src" depends="all, javadocs">
  475. <echo message="Building the source distribution files (zip,tar)"/>
  476. <mkdir dir="${dist.src.result.dir}"/>
  477. <copy todir="${dist.src.result.dir}">
  478. <fileset refid="dist.src"/>
  479. </copy>
  480. <copy todir="${dist.src.result.dir}/javadocs">
  481. <fileset dir="${build.javadocs}"/>
  482. </copy>
  483. <mkdir dir="${dist.src.result.dir}/build"/>
  484. <copy todir="${dist.src.result.dir}/build" file="build/fop.jar"/>
  485. <chmod file="${dist.src.result.dir}/build.sh" perm="ugo+rx"/>
  486. <chmod file="${dist.src.result.dir}/fop.sh" perm="ugo+rx"/>
  487. <zip zipfile="${Name}-${version}-src.zip" basedir="${dist.src.dir}" includes="**"/>
  488. <tar tarfile="${Name}-${version}-src.tar" basedir="${dist.src.dir}" includes="**"/>
  489. <gzip zipfile="${Name}-${version}-src.tar.gz" src="${Name}-${version}-src.tar"/>
  490. <delete file="${Name}-${version}-src.tar"/>
  491. </target>
  492. <!-- =================================================================== -->
  493. <!-- Clean targets -->
  494. <!-- =================================================================== -->
  495. <target name="clean" depends="init" description="Cleans the build directory">
  496. <delete dir="${build.dir}"/>
  497. </target>
  498. <target name="distclean" depends="clean" description="Cleans the distribution target directories">
  499. <delete dir="${dist.src.dir}"/>
  500. <delete dir="${dist.bin.dir}"/>
  501. <delete>
  502. <fileset dir="${basedir}" includes="${Name}-*.tar.gz"/>
  503. <fileset dir="${basedir}" includes="${Name}-*.zip"/>
  504. </delete>
  505. </target>
  506. </project>