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

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