PageRenderTime 38ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/docs/enum/build.xml

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
XML | 232 lines | 135 code | 65 blank | 32 comment | 0 complexity | 1d1032133145668e0bac1838e35280b9 MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  1. <project name="Enum" default="compile" basedir=".">
  2. <!--
  3. "Enum" component of the Jakarta Commons Subproject
  4. $Id$
  5. -->
  6. <!-- ========== Initialize Properties ===================================== -->
  7. <property file="build.properties"/> <!-- Component local -->
  8. <property file="../build.properties"/> <!-- Commons local -->
  9. <property file="${user.home}/build.properties"/> <!-- User local -->
  10. <!-- ========== External Dependencies ===================================== -->
  11. <!-- The directory containing your binary distribution of JUnit,
  12. version 3.2 or later -->
  13. <property name="junit.home" value="/usr/local/junit3.5"/>
  14. <!-- ========== Derived Values ============================================ -->
  15. <!-- The pathname of the "junit.jar" JAR file -->
  16. <property name="junit.jar" value="${junit.home}/junit.jar"/>
  17. <!-- ========== Component Declarations ==================================== -->
  18. <!-- The name of this component -->
  19. <property name="component.name" value="enum"/>
  20. <!-- The title of this component -->
  21. <property name="component.title" value="Flexible Enums in Java"/>
  22. <!-- The current version number of this component -->
  23. <property name="component.version" value="0.1-dev"/>
  24. <!-- The base directory for compilation targets -->
  25. <property name="build.home" value="target"/>
  26. <!-- The base directory for component configuration files -->
  27. <property name="conf.home" value="src/conf"/>
  28. <!-- The base directory for distribution targets -->
  29. <property name="dist.home" value="enum"/>
  30. <!-- The base directory for component sources -->
  31. <property name="source.home" value="src/java"/>
  32. <!-- The base directory for unit test sources -->
  33. <property name="test.home" value="src/test"/>
  34. <!-- The base directory for documentation -->
  35. <property name="docs.home" value="docs"/>
  36. <!-- The base directory for documentation -->
  37. <property name="images.home" value="docs/images"/>
  38. <!-- ========== Compiler Defaults ========================================= -->
  39. <!-- Should Java compilations set the 'debug' compiler option? -->
  40. <property name="compile.debug" value="true"/>
  41. <!-- Should Java compilations set the 'deprecation' compiler option? -->
  42. <property name="compile.deprecation" value="true"/>
  43. <!-- Should Java compilations set the 'optimize' compiler option? -->
  44. <property name="compile.optimize" value="true"/>
  45. <!-- Construct compile classpath -->
  46. <path id="compile.classpath">
  47. <pathelement location="${build.home}/classes"/>
  48. </path>
  49. <!-- ========== Test Execution Defaults =================================== -->
  50. <!-- Construct unit test classpath -->
  51. <path id="test.classpath">
  52. <pathelement location="${build.home}/classes"/>
  53. <pathelement location="${build.home}/tests"/>
  54. <pathelement location="${junit.jar}"/>
  55. </path>
  56. <!-- Should all tests fail if one does? -->
  57. <property name="test.failonerror" value="true"/>
  58. <!-- The test runner to execute -->
  59. <property name="test.runner" value="junit.textui.TestRunner"/>
  60. <!-- ========== Executable Targets ======================================== -->
  61. <target name="init"
  62. description="Initialize and evaluate conditionals">
  63. <echo message="-------- ${component.name} ${component.version} --------"/>
  64. <filter token="name" value="${component.name}"/>
  65. <filter token="version" value="${component.version}"/>
  66. </target>
  67. <target name="prepare" depends="init"
  68. description="Prepare build directory">
  69. <mkdir dir="${build.home}"/>
  70. <mkdir dir="${build.home}/classes"/>
  71. <mkdir dir="${build.home}/conf"/>
  72. <mkdir dir="${build.home}/tests"/>
  73. </target>
  74. <target name="static" depends="prepare"
  75. description="Copy static files to build directory">
  76. <tstamp/>
  77. <copy todir="${build.home}/conf" filtering="on">
  78. <fileset dir="${conf.home}" includes="*.MF"/>
  79. </copy>
  80. </target>
  81. <target name="compile" depends="static"
  82. description="Compile shareable components">
  83. <javac srcdir="${source.home}"
  84. destdir="${build.home}/classes"
  85. debug="${compile.debug}"
  86. deprecation="${compile.deprecation}"
  87. optimize="${compile.optimize}">
  88. <classpath refid="compile.classpath"/>
  89. </javac>
  90. <copy todir="${build.home}/classes" filtering="on">
  91. <fileset dir="${source.home}" excludes="**/*.java"/>
  92. </copy>
  93. </target>
  94. <target name="compile.tests" depends="compile"
  95. description="Compile unit test cases">
  96. <javac srcdir="${test.home}"
  97. destdir="${build.home}/tests"
  98. debug="${compile.debug}"
  99. deprecation="${compile.deprecation}"
  100. optimize="${compile.optimize}">
  101. <classpath refid="test.classpath"/>
  102. </javac>
  103. <copy todir="${build.home}/tests" filtering="on">
  104. <fileset dir="${test.home}" excludes="**/*.java"/>
  105. </copy>
  106. </target>
  107. <target name="clean"
  108. description="Clean build and distribution directories">
  109. <delete dir="${build.home}"/>
  110. <delete dir="${dist.home}"/>
  111. </target>
  112. <target name="all" depends="clean,compile"
  113. description="Clean and compile all components"/>
  114. <target name="javadoc" depends="compile"
  115. description="Create component Javadoc documentation">
  116. <mkdir dir="${dist.home}"/>
  117. <mkdir dir="${dist.home}/docs"/>
  118. <mkdir dir="${dist.home}/docs/api"/>
  119. <javadoc sourcepath="${source.home}"
  120. destdir="${dist.home}/docs/api"
  121. packagenames="com.plotnix.enum.*"
  122. author="true"
  123. private="false"
  124. version="true"
  125. doctitle="&lt;h1&gt;${component.title}&lt;/h1&gt;"
  126. windowtitle="${component.title} (Version ${component.version})"
  127. bottom="Copyright (c) 2001 - PLOTNIX, Inc"/>
  128. </target>
  129. <target name="dist" depends="compile,javadoc"
  130. description="Create binary distribution">
  131. <mkdir dir="${dist.home}"/>
  132. <copy file="build.xml"
  133. todir="${dist.home}"/>
  134. <copy file="build.properties.sample"
  135. todir="${dist.home}"/>
  136. <copy file="${docs.home}/Enum.htm"
  137. todir="${dist.home}/docs"/>
  138. <copy todir="${dist.home}/docs/images" >
  139. <fileset dir="${images.home}"/>
  140. </copy>
  141. <copy todir="${dist.home}" >
  142. <fileset dir="${source.home}"/>
  143. </copy>
  144. <copy file="${docs.home}/Enum.htm"
  145. todir="${dist.home}/docs"/>
  146. <mkdir dir="${dist.home}/test"/>
  147. <copy todir="${dist.home}/test" >
  148. <fileset dir="${test.home}"/>
  149. </copy>
  150. <jar jarfile="${dist.home}/${component.name}.jar"
  151. basedir="${build.home}/classes"
  152. manifest="${build.home}/conf/MANIFEST.MF"/>
  153. </target>
  154. <!-- ========== Unit Test Targets ========================================= -->
  155. <target name="test" depends="compile.tests,
  156. test.enum"
  157. description="Run all unit test cases">
  158. </target>
  159. <target name="test.enum">
  160. <echo message="Running Enum tests ..."/>
  161. <java classname="${test.runner}" fork="yes"
  162. failonerror="${test.failonerror}">
  163. <arg value="com.plotnix.enum.EnumTestCase"/>
  164. <classpath refid="test.classpath"/>
  165. </java>
  166. </target>
  167. </project>