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.

compiling.xml 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
  18. <document>
  19. <header>
  20. <title>Apache™ FOP: Building from Source Code</title>
  21. <version>$Revision$</version>
  22. </header>
  23. <body>
  24. <section id="build-needed">
  25. <title>Do You Need To Build?</title>
  26. <!-- text for released versions -->
  27. <!-- <p>
  28. FOP distributions are either pre-compiled binary or source.
  29. If you are using a binary distribution, it is already built and there is no need to build it again.
  30. See the <a href="../download.html">Download Instructions</a> for information about whether a
  31. binary or source distribution is best for your needs.
  32. </p>-->
  33. <!-- /text for released versions -->
  34. <!-- text for trunk -->
  35. <p>
  36. Apache™ FOP snapshots are either pre-compiled binary or source.
  37. If you are using a binary snapshot, it is already built and there is no need to build it again.
  38. If you got the source code from a repository snapshot or via Subversion you will need to build FOP.
  39. See the <a href="../download.html">Download Instructions</a> for information about where to obtain binary or repository snapshots, and whether a
  40. binary or source snapshot is best for your needs.
  41. </p>
  42. <!-- /text for trunk -->
  43. </section>
  44. <section id="env">
  45. <title>Set Up Your Environment</title>
  46. <section id="env-jdk">
  47. <title>JDK</title>
  48. <p>
  49. Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.4
  50. (A Java Runtime Environment is not sufficient).
  51. </p>
  52. </section>
  53. <section id="env-classpath">
  54. <title>CLASSPATH</title>
  55. <p>
  56. There is generally no need to setup a classpath. All libraries needed to compile FOP are included
  57. in the source distribution and are referenced by the build script.
  58. You will only need to adjust the classpath if you build FOP in some other way. See the build
  59. script build.xml for details.
  60. </p>
  61. </section>
  62. <section id="env-java-home">
  63. <title>JAVA_HOME</title>
  64. <p>
  65. The build script uses <a href="ext:ant">Apache Ant</a>, a popular
  66. Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
  67. your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally
  68. does not need this setting.
  69. </p>
  70. </section>
  71. <section id="env-ant">
  72. <title>Apache Ant</title>
  73. <p>
  74. <a href="ext:ant">Apache Ant</a> (Version 1.7 or later) must be installed in order to
  75. build FOP. Following best practices we don't include Ant with FOP anymore. You can find the
  76. <a href="ext:ant/manual/">instructions to install Ant in the Ant manual</a> on the web.
  77. </p>
  78. </section>
  79. </section>
  80. <section id="build-script">
  81. <title>Run the Build Script</title>
  82. <p>
  83. Change to the FOP root directory and build FOP by executing the build script (build.xml)
  84. using the "ant" command.
  85. </p>
  86. <note>
  87. The "ant" command is only available on your system if you've properly
  88. <a href="ext:ant/manual/">installed Apache Ant</a> and added Ant's location to the PATH
  89. environment variable.
  90. </note>
  91. <p>
  92. The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It
  93. contains information for numerous build targets, many of which are building blocks to more
  94. useful target, and others which are primarily used by the FOP developers.
  95. You may benefit from looking through this file to learn more about the various build targets.
  96. To obtain a complete list of useful build targets:
  97. </p>
  98. <source>ant -projecthelp</source>
  99. <p>The most useful targets are:</p>
  100. <ul>
  101. <li>
  102. <strong>package</strong>: Generates the JAR files (default). This is the normal build that
  103. produces a jar file usable for running FOP.
  104. </li>
  105. <li>
  106. <strong>clean </strong>: Cleans the build directory. This is useful for making sure that
  107. any build errors are cleaned up before starting a new build. It should not ordinarily be
  108. needed, but may be helpful if you are having problems with the build process itself.
  109. </li>
  110. <li>
  111. <strong>javadocs</strong>: Creates the FOP API documentation.
  112. <note>A minimum JDK version of 1.4.2 is required for generating the javadocs.</note>
  113. </li>
  114. </ul>
  115. <p>To run the build:</p>
  116. <source>ant [target ...]</source>
  117. <p>For example to do a normal build for the "all" target (which is the default):</p>
  118. <source>ant</source>
  119. <p>OR</p>
  120. <source>ant all</source>
  121. <p>To clean the build directory first:</p>
  122. <source>ant clean all</source>
  123. <note>
  124. If you want to shorten the build time you can just call the "package" target which
  125. doesn't perform any automated tests during the build.
  126. </note>
  127. </section>
  128. <section id="problems">
  129. <title id="Troubleshooting">Troubleshooting</title>
  130. <p>If you have problems building FOP, please try the following:</p>
  131. <ul>
  132. <li>Run the build with the target of "clean", then rerun the build.</li>
  133. <li>Delete the build directory completely, then rerun the build.</li>
  134. <li>
  135. Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar,
  136. or another dependency product somewhere in your CLASSPATH.
  137. </li>
  138. <li>
  139. If the build still fails, see the <a href="../gethelp.html">Getting Help</a>
  140. page for further help.
  141. </li>
  142. </ul>
  143. </section>
  144. </body>
  145. </document>