PageRenderTime 68ms CodeModel.GetById 24ms app.highlight 16ms RepoModel.GetById 7ms app.codeStats 9ms

/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
  1<project name="Enum" default="compile" basedir=".">
  2
  3
  4<!--
  5        "Enum" component of the Jakarta Commons Subproject
  6        $Id$
  7-->
  8
  9
 10<!-- ========== Initialize Properties ===================================== -->
 11
 12
 13  <property file="build.properties"/>                <!-- Component local   -->
 14  <property file="../build.properties"/>             <!-- Commons local     -->
 15  <property file="${user.home}/build.properties"/>   <!-- User local        -->
 16
 17<!-- ========== External Dependencies ===================================== -->
 18
 19
 20  <!-- The directory containing your binary distribution of JUnit,
 21       version 3.2 or later -->
 22  <property name="junit.home"              value="/usr/local/junit3.5"/>
 23
 24
 25<!-- ========== Derived Values ============================================ -->
 26
 27
 28  <!-- The pathname of the "junit.jar" JAR file -->
 29  <property name="junit.jar"               value="${junit.home}/junit.jar"/>
 30
 31<!-- ========== Component Declarations ==================================== -->
 32
 33
 34  <!-- The name of this component -->
 35  <property name="component.name"          value="enum"/>
 36
 37  <!-- The title of this component -->
 38  <property name="component.title"         value="Flexible Enums in Java"/>
 39
 40  <!-- The current version number of this component -->
 41  <property name="component.version"       value="0.1-dev"/>
 42
 43  <!-- The base directory for compilation targets -->
 44  <property name="build.home"              value="target"/>
 45
 46  <!-- The base directory for component configuration files -->
 47  <property name="conf.home"               value="src/conf"/>
 48
 49  <!-- The base directory for distribution targets -->
 50  <property name="dist.home"               value="enum"/>
 51
 52  <!-- The base directory for component sources -->
 53  <property name="source.home"             value="src/java"/>
 54
 55  <!-- The base directory for unit test sources -->
 56  <property name="test.home"               value="src/test"/>
 57
 58  <!-- The base directory for documentation -->
 59  <property name="docs.home"               value="docs"/>
 60
 61  <!-- The base directory for documentation -->
 62  <property name="images.home"             value="docs/images"/>
 63
 64<!-- ========== Compiler Defaults ========================================= -->
 65
 66
 67  <!-- Should Java compilations set the 'debug' compiler option? -->
 68  <property name="compile.debug"           value="true"/>
 69
 70  <!-- Should Java compilations set the 'deprecation' compiler option? -->
 71  <property name="compile.deprecation"     value="true"/>
 72
 73  <!-- Should Java compilations set the 'optimize' compiler option? -->
 74  <property name="compile.optimize"        value="true"/>
 75
 76  <!-- Construct compile classpath -->
 77  <path id="compile.classpath">
 78    <pathelement location="${build.home}/classes"/>
 79  </path>
 80
 81
 82<!-- ========== Test Execution Defaults =================================== -->
 83
 84
 85  <!-- Construct unit test classpath -->
 86  <path id="test.classpath">
 87    <pathelement location="${build.home}/classes"/>
 88    <pathelement location="${build.home}/tests"/>
 89    <pathelement location="${junit.jar}"/>
 90  </path>
 91
 92  <!-- Should all tests fail if one does? -->
 93  <property name="test.failonerror"        value="true"/>
 94
 95  <!-- The test runner to execute -->
 96  <property name="test.runner"             value="junit.textui.TestRunner"/>
 97
 98
 99<!-- ========== Executable Targets ======================================== -->
100
101
102  <target name="init"
103   description="Initialize and evaluate conditionals">
104    <echo message="-------- ${component.name} ${component.version} --------"/>
105    <filter  token="name"                  value="${component.name}"/>
106    <filter  token="version"               value="${component.version}"/>
107  </target>
108
109
110  <target name="prepare" depends="init"
111   description="Prepare build directory">
112    <mkdir dir="${build.home}"/>
113    <mkdir dir="${build.home}/classes"/>
114    <mkdir dir="${build.home}/conf"/>
115    <mkdir dir="${build.home}/tests"/>
116  </target>
117
118
119  <target name="static" depends="prepare"
120   description="Copy static files to build directory">
121    <tstamp/>
122    <copy  todir="${build.home}/conf" filtering="on">
123      <fileset dir="${conf.home}" includes="*.MF"/>
124    </copy>
125  </target>
126
127
128  <target name="compile" depends="static"
129   description="Compile shareable components">
130    <javac  srcdir="${source.home}"
131           destdir="${build.home}/classes"
132             debug="${compile.debug}"
133       deprecation="${compile.deprecation}"
134          optimize="${compile.optimize}">
135      <classpath refid="compile.classpath"/>
136    </javac>
137    <copy    todir="${build.home}/classes" filtering="on">
138      <fileset dir="${source.home}" excludes="**/*.java"/>
139    </copy>
140  </target>
141
142
143  <target name="compile.tests" depends="compile"
144   description="Compile unit test cases">
145    <javac  srcdir="${test.home}"
146           destdir="${build.home}/tests"
147             debug="${compile.debug}"
148       deprecation="${compile.deprecation}"
149          optimize="${compile.optimize}">
150      <classpath refid="test.classpath"/>
151    </javac>
152    <copy    todir="${build.home}/tests" filtering="on">
153      <fileset dir="${test.home}" excludes="**/*.java"/>
154    </copy>
155  </target>
156
157
158  <target name="clean"
159   description="Clean build and distribution directories">
160    <delete    dir="${build.home}"/>
161    <delete    dir="${dist.home}"/>
162  </target>
163
164
165  <target name="all" depends="clean,compile"
166   description="Clean and compile all components"/>
167
168
169  <target name="javadoc" depends="compile"
170   description="Create component Javadoc documentation">
171    <mkdir      dir="${dist.home}"/>
172    <mkdir      dir="${dist.home}/docs"/>
173    <mkdir      dir="${dist.home}/docs/api"/>
174    <javadoc sourcepath="${source.home}"
175                destdir="${dist.home}/docs/api"
176           packagenames="com.plotnix.enum.*"
177                 author="true"
178                private="false"
179                version="true"
180               doctitle="&lt;h1&gt;${component.title}&lt;/h1&gt;"
181            windowtitle="${component.title} (Version ${component.version})"
182                 bottom="Copyright (c) 2001 - PLOTNIX, Inc"/>
183  </target>
184
185
186  <target name="dist" depends="compile,javadoc"
187   description="Create binary distribution">
188    <mkdir      dir="${dist.home}"/>
189    <copy      file="build.xml"
190              todir="${dist.home}"/>
191    <copy      file="build.properties.sample"
192              todir="${dist.home}"/>
193    <copy      file="${docs.home}/Enum.htm"
194              todir="${dist.home}/docs"/>
195    <copy    todir="${dist.home}/docs/images" >
196      <fileset dir="${images.home}"/>
197    </copy>
198    <copy    todir="${dist.home}" >
199      <fileset dir="${source.home}"/>
200    </copy>
201    <copy      file="${docs.home}/Enum.htm"
202              todir="${dist.home}/docs"/>
203
204    <mkdir      dir="${dist.home}/test"/>
205    <copy    todir="${dist.home}/test" >
206      <fileset dir="${test.home}"/>
207    </copy>
208    <jar    jarfile="${dist.home}/${component.name}.jar"
209            basedir="${build.home}/classes"
210           manifest="${build.home}/conf/MANIFEST.MF"/>
211  </target>
212
213
214<!-- ========== Unit Test Targets ========================================= -->
215
216
217  <target name="test"  depends="compile.tests,
218                                test.enum"
219   description="Run all unit test cases">
220  </target>
221
222
223  <target name="test.enum">
224    <echo message="Running Enum tests ..."/>
225    <java classname="${test.runner}" fork="yes"
226        failonerror="${test.failonerror}">
227      <arg value="com.plotnix.enum.EnumTestCase"/>
228      <classpath refid="test.classpath"/>
229    </java>
230  </target>
231
232</project>