build.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <!-- An ANT build file for JCommon. -->
  2. <!-- Written by David Gilbert. -->
  3. <!-- 24-Jan-2003 -->
  4. <!-- This script has been tested with Ant version 1.8.2. -->
  5. <!-- Several temporary directories are created while the script is -->
  6. <!-- running: "../build" and "../distribution". -->
  7. <!-- A "../javadoc" directory will be created for the Javadoc -->
  8. <!-- HTML pages. -->
  9. <!-- The script should work for the distribution and also the CVS -->
  10. <!-- repository (which is shared with the JFreeChart project in a -->
  11. <!-- slightly messy way). -->
  12. <project name="jcommon" default="all" basedir="..">
  13. <!-- Initialisation. -->
  14. <target name="initialise" description="Initialise required settings.">
  15. <tstamp/>
  16. <property name="builddir" value="build"/>
  17. <dirname property="antfile.dir" file="${ant.file}"/>
  18. <property file="${antfile.dir}/build.properties"/>
  19. <path id="build-xml.classpath">
  20. <pathelement location="${libdir}/${jaxp-jar-file}"/>
  21. <pathelement location="${jcommon-jar-file}"/>
  22. </path>
  23. <path id="junit.classpath">
  24. <pathelement location="${jcommon-jar-file}"/>
  25. <pathelement location="${lib}/${jaxp-jar-file}"/>
  26. <pathelement location="${junit-dir}/${junit-jar-file}"/>
  27. </path>
  28. </target>
  29. <!-- Compile the JCommon classes -->
  30. <target name="compile" depends="initialise"
  31. description="Compile the JCommon source code.">
  32. <!-- create a temp build directory -->
  33. <mkdir dir="${builddir}"/>
  34. <!-- compile the source -->
  35. <javac srcdir="src/main/java"
  36. destdir="${builddir}"
  37. deprecation="${build.deprecation}" debug="${build.debug}"
  38. optimize="${build.optimize}" target="${build.target}" source="${build.source}">
  39. <include name="org/jfree/*"/>
  40. <include name="org/jfree/base/**"/>
  41. <include name="org/jfree/date/*"/>
  42. <include name="org/jfree/io/*"/>
  43. <include name="org/jfree/layout/*"/>
  44. <include name="org/jfree/resources/*"/>
  45. <include name="org/jfree/text/*"/>
  46. <include name="org/jfree/threads/*"/>
  47. <include name="org/jfree/ui/*"/>
  48. <include name="org/jfree/ui/action/*"/>
  49. <include name="org/jfree/ui/tabbedui/*"/>
  50. <include name="org/jfree/ui/about/*"/>
  51. <include name="org/jfree/ui/about/resources/*"/>
  52. <include name="org/jfree/util/*"/>
  53. <include name="com/keypoint/*"/>
  54. </javac>
  55. <!-- copy across .properties files -->
  56. <copy todir="${builddir}/org/jfree/ui/">
  57. <fileset dir="src/main/java/org/jfree/ui">
  58. <include name="*.properties"/>
  59. </fileset>
  60. </copy>
  61. <copy todir="${builddir}/org/jfree/ui/about/">
  62. <fileset dir="src/main/java/org/jfree/ui/about">
  63. <include name="*.txt"/>
  64. </fileset>
  65. </copy>
  66. <!-- copy across .properties files -->
  67. <copy todir="${builddir}/org/jfree/base/">
  68. <fileset dir="src/main/java/org/jfree/base">
  69. <include name="*.properties"/>
  70. </fileset>
  71. </copy>
  72. <copy todir="${builddir}/org/jfree/base/log">
  73. <fileset dir="src/main/java/org/jfree/base/log">
  74. <include name="*.properties"/>
  75. </fileset>
  76. </copy>
  77. <!-- make the jar -->
  78. <jar jarfile="${jcommon-jar-file}" basedir="${builddir}"/>
  79. <!-- delete the temp directory -->
  80. <delete dir="${builddir}"/>
  81. </target>
  82. <!-- Compile the JCommon classes -->
  83. <target name="compile-xml" depends="compile"
  84. description="Compile the JCommon source code.">
  85. <!-- create a temp build directory -->
  86. <mkdir dir="${builddir}"/>
  87. <!-- compile the source -->
  88. <javac srcdir="src/main/java"
  89. destdir="${builddir}"
  90. deprecation="${build.deprecation}" debug="${build.debug}"
  91. optimize="${build.optimize}" target="${build.target}" source="${build.source}">
  92. <classpath refid="build-xml.classpath" />
  93. <include name="org/jfree/xml/**"/>
  94. </javac>
  95. <!-- copy across .properties files -->
  96. <copy todir="${builddir}/org/jfree/xml/">
  97. <fileset dir="src/main/java/org/jfree/xml">
  98. <include name="*.properties"/>
  99. <include name="*.dtd"/>
  100. </fileset>
  101. </copy>
  102. <!-- make the jar -->
  103. <jar jarfile="${jcommon-xml-jar-file}" basedir="${builddir}"/>
  104. <!-- delete the temp directory -->
  105. <delete dir="${builddir}"/>
  106. </target>
  107. <!-- Generate the JCommon JavaDoc HTML pages -->
  108. <target name="javadoc" depends="initialise">
  109. <delete dir="javadoc"/>
  110. <mkdir dir="javadoc"/>
  111. <javadoc destdir="javadoc"
  112. windowtitle="JCommon Class Library (version ${jcommon.version})"
  113. overview="src/main/java/overview.html"
  114. linksource="true">
  115. <classpath refid="build-xml.classpath"/>
  116. <packageset dir="src/main/java" defaultexcludes="yes">
  117. <include name="org/jfree"/>
  118. <include name="org/jfree/base"/>
  119. <include name="org/jfree/date"/>
  120. <include name="org/jfree/io"/>
  121. <include name="org/jfree/layout"/>
  122. <include name="org/jfree/resources"/>
  123. <include name="org/jfree/text"/>
  124. <include name="org/jfree/threads"/>
  125. <include name="org/jfree/ui"/>
  126. <include name="org/jfree/ui/action"/>
  127. <include name="org/jfree/ui/tabbedui"/>
  128. <include name="org/jfree/ui/about"/>
  129. <include name="org/jfree/ui/about/resources"/>
  130. <include name="org/jfree/util"/>
  131. <include name="com/keypoint"/>
  132. <include name="org/jfree/xml/**"/>
  133. </packageset>
  134. </javadoc>
  135. </target>
  136. <target name="fill-dist-dir">
  137. <!-- copy across README -->
  138. <copy file="README.md"
  139. tofile="distribution/README.md" failonerror="false"/>
  140. <!-- copy across LICENCE -->
  141. <copy file="LICENSE"
  142. tofile="distribution/LICENSE"/>
  143. <!-- copy across runtime jar file -->
  144. <copy file="${jcommon-jar-file}"
  145. tofile="distribution/${jcommon-jar-file}"/>
  146. <!-- copy across jcommon-xml jar file -->
  147. <copy file="${jcommon-xml-jar-file}"
  148. tofile="distribution/${jcommon-xml-jar-file}"/>
  149. <!-- copy across maven xml files -->
  150. <copy file="pom.xml" tofile="distribution/pom.xml"/>
  151. <!-- copy across junit jar file -->
  152. <copy file="${junit-dir}/${junit-jar-file}" tofile="distribution/lib/junit.jar"/>
  153. <!-- copy across source files -->
  154. <copy todir="distribution/src">
  155. <fileset dir="src"/>
  156. </copy>
  157. <!-- copy across ant build file (this file) -->
  158. <copy file="ant/build.xml"
  159. tofile="distribution/ant/build.xml" failonerror="false"/>
  160. <copy file="ant/build.properties"
  161. tofile="distribution/ant/build.properties"/>
  162. <!-- copy across checkstyle property file -->
  163. <copy todir="distribution/checkstyle">
  164. <fileset dir="checkstyle"/>
  165. </copy>
  166. </target>
  167. <!-- Make .zip distribution for JCommon -->
  168. <target name="zip" depends="compile-xml">
  169. <!-- make a temporary distribution directory -->
  170. <mkdir dir="distribution"/>
  171. <antcall target="fill-dist-dir"/>
  172. <!-- convert end-of-line characters in text files -->
  173. <fixcrlf srcdir="distribution/src"
  174. eol="crlf" eof="remove"/>
  175. <!-- make the zip file -->
  176. <zip zipfile="${jcommon.name}-${jcommon.version}.zip">
  177. <zipfileset dir="distribution"
  178. prefix="${jcommon.name}-${jcommon.version}"/>
  179. </zip>
  180. <!-- delete the temporary distribution directory -->
  181. <delete dir="distribution"/>
  182. </target>
  183. <!-- Make .tar.gz distribution for JCommon -->
  184. <target name="targz" depends="compile-xml">
  185. <!-- make a temporary distribution directory -->
  186. <mkdir dir="distribution"/>
  187. <antcall target="fill-dist-dir"/>
  188. <!-- convert end-of-line characters in text files -->
  189. <fixcrlf srcdir="distribution/src"
  190. eol="lf" eof="remove"/>
  191. <!-- make the tar.gz file -->
  192. <tar tarfile="${jcommon.name}-${jcommon.version}.tar">
  193. <tarfileset dir="distribution"
  194. prefix="${jcommon.name}-${jcommon.version}"/>
  195. </tar>
  196. <gzip zipfile="${jcommon.name}-${jcommon.version}.tar.gz"
  197. src="${jcommon.name}-${jcommon.version}.tar"/>
  198. <delete file="${jcommon.name}-${jcommon.version}.tar"/>
  199. <!-- delete the temporary distribution directory -->
  200. <delete dir="distribution"/>
  201. </target>
  202. <target name="maven-bundle" depends="zip" >
  203. <!-- make a temporary distribution directory -->
  204. <mkdir dir="distribution"/>
  205. <!-- copy across LICENCE -->
  206. <copy file="LICENSE" tofile="distribution/LICENSE"/>
  207. <filterchain id="version.filters">
  208. <replacetokens>
  209. <token key="VERSION" value="${jcommon.version}"/>
  210. </replacetokens>
  211. </filterchain>
  212. <!-- copy across runtime jar file -->
  213. <copy file="${jcommon-jar-file}" tofile="distribution/${jcommon-jar-file}"/>
  214. <!-- make the jar -->
  215. <jar jarfile="${jcommon-bundle-file}" basedir="distribution"/>
  216. <!-- delete the temporary distribution directory -->
  217. <delete dir="distribution"/>
  218. <!-- make a temporary distribution directory -->
  219. <mkdir dir="distribution"/>
  220. <!-- copy across LICENCE -->
  221. <copy file="LICENSE" tofile="distribution/LICENSE"/>
  222. <!-- copy across runtime jar file -->
  223. <copy file="${jcommon-xml-jar-file}" tofile="distribution/${jcommon-xml-jar-file}"/>
  224. <!-- make the jar -->
  225. <jar jarfile="${jcommon-xml-bundle-file}" basedir="distribution"/>
  226. <!-- delete the temporary distribution directory -->
  227. <delete dir="distribution"/>
  228. </target>
  229. <!-- ALL -->
  230. <target name="all"
  231. depends="compile,compile-xml,javadoc,zip,targz,maven-bundle"
  232. description="Compiles JCommon, builds the jar files, generates the Javadoc HTML pages and creates distribution files (.zip and .tar.gz).">
  233. </target>
  234. </project>