ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/build.xml
Revision: 1.1
Committed: Thu Jun 14 17:04:13 2001 UTC (24 years, 6 months ago) by ajm
Content type: text/xml
Branch: MAIN
Log Message:
New ant build scripts.

File Contents

# Content
1 <!-- build file for i-scream CMS DB Reporter -->
2 <!-- $Id: build.xml,v 1.1 2001/06/14 15:38:15 ajm4 Exp $ -->
3
4 <project name="iscream-dbreporter" default="usage">
5
6 <!--
7 =====================================================
8 Initialisation & Configuration
9 =====================================================
10 -->
11
12 <property name="SOURCEROOT" value="${basedir}"/>
13 <property name="CONFIGFILE" value="build.config"/>
14
15 <target name="config">
16 <echo message="Reading build configuration"/>
17 <property file="${CONFIGFILE}"/>
18 </target>
19
20 <!--
21 =====================================================
22 Usage
23 =====================================================
24 -->
25
26 <target name="usage">
27 <echo>
28
29 These are the targets supported by this ANT build script:
30
31 fetch - fetch all the JAR library files
32
33 build - compile all source code
34 package - generate JAR package and distributions
35
36 cvsbuild - build from cvs tag
37 use -Drev=TAG switch to specify cvs tag
38
39 javadoc - generate javadoc API
40 install - install server
41 use -Dprefix=/path/ switch to specify dest
42 run - run Conient
43
44 clean - clean all generated files
45 distclean - remove 'fetched' libraries + clean
46
47 Recommend to run the following target order:
48
49 fetch package javadoc install
50 </echo>
51 </target>
52
53 <target name="help">
54 <antcall target="usage"/>
55 </target>
56
57 <!--
58 =====================================================
59 Fetch required libraries (not in dependency tree)
60 =====================================================
61 -->
62
63 <!-- this uses static names, which is messy -->
64 <!-- distclean target has same problem -->
65 <target name="fetch" depends="config">
66 <get
67 src="${LIBURL}/crimson.jar"
68 dest="${LIBDIR}/crimson.jar"
69 verbose="true" usetimestamp="true"
70 />
71 <get
72 src="${LIBURL}/jaxp.jar"
73 dest="${LIBDIR}/jaxp.jar"
74 verbose="true" usetimestamp="true"
75 />
76 <get
77 src="${LIBURL}/mm.mysql-2.0.4-bin.jar"
78 dest="${LIBDIR}/mm.mysql-2.0.4-bin.jar"
79 verbose="true" usetimestamp="true"
80 />
81 <get
82 src="${LIBURL}/Acme.jar"
83 dest="${LIBDIR}/Acme.jar"
84 verbose="true" usetimestamp="true"
85 />
86 <get
87 src="${LIBURL}/iscream-util.jar"
88 dest="${LIBDIR}/iscream-util.jar"
89 verbose="true" usetimestamp="true"
90 />
91 <!-- also get jacorb.properties? -->
92 </target>
93
94
95 <!--
96 =====================================================
97 Source code compilation
98 =====================================================
99 -->
100
101 <target name="build" depends="config">
102 <javac
103 srcdir="${SOURCEROOT}"
104 destdir="${BUILDDIR}"
105 classpath="${JCCLASSPATH}"
106 includes="uk/**/*.java"
107 debug="${JCDEBUG}"
108 optimize="${JCOPTIM}"
109 deprecation="${JCDEPRE}"
110 />
111 </target>
112
113 <!--
114 =====================================================
115 Package creation
116 =====================================================
117 -->
118
119 <target name="makejar" depends="build">
120 <echo file="${BUILDDIR}/MANIFEST_TMP"
121 >Manifest-Version: 1.0
122 Created-By: www.i-scream.org.uk
123 Main-Class: ${MFMAINCLASS}
124 Class-Path: ${MFCLPATH}
125 </echo>
126 <jar
127 jarfile="${BUILDDIR}/${DBREPORTERJAR}"
128 basedir="${BUILDDIR}"
129 includes="uk/**/*.class"
130 manifest="${BUILDDIR}/MANIFEST_TMP"
131 />
132 <delete file="${BUILDDIR}/MANIFEST_TMP"/>
133 </target>
134
135 <target name="maketardist" depends="makejar">
136 <tar
137 longfile="fail"
138 basedir="${BUILDDIR}"
139 tarfile="${BUILDDIR}/${TARFILE}"
140 includes="${DBREPORTERJAR}, run.sh, lib/**, etc/**, README"
141 />
142 <gzip src="${BUILDDIR}/${TARFILE}" zipfile="${BUILDDIR}/${TARGZFILE}"/>
143 <delete file="${BUILDDIR}/${TARFILE}"/>
144 </target>
145
146 <target name="makezipdist" depends="makejar">
147 <zip
148 basedir="${BUILDDIR}"
149 zipfile="${BUILDDIR}/${ZIPFILE}"
150 includes="${DBREPORTERJAR}, run.bat, lib/**, etc/**, README"
151 />
152 </target>
153
154 <target name="package" depends="maketardist, makezipdist"/>
155
156 <!--
157 =====================================================
158 Cleaning
159 =====================================================
160 -->
161
162 <target name="clean" depends="config">
163 <delete dir="${BUILDDIR}/${ROOTPKG}"/>
164 <delete dir="${JDOCDIR}"/>
165 <delete dir="${CVSBUILDTEMP}"/>
166 <delete>
167 <fileset dir="${BUILDDIR}">
168 <include name="${DBREPORTERJAR}"/>
169 <include name="${ARCNAME}*${TAREXT}"/>
170 <include name="${ARCNAME}*${TARGZEXT}"/>
171 <include name="${ARCNAME}*${ZIPEXT}"/>
172 </fileset>
173 </delete>
174 </target>
175
176 <target name="distclean" depends="clean">
177 <!-- this is messy, we should only delete specific jars -->
178 <delete>
179 <fileset dir="${LIBDIR}" includes="*.jar"/>
180 </delete>
181 </target>
182
183 <!--
184 =====================================================
185 Running
186 =====================================================
187 -->
188
189 <!-- is this really the best way to do this? no... -->
190 <target name="run" depends="config">
191 <java classname="${MFMAINCLASS}" dir="${BUILDDIR}" fork="yes">
192 <classpath path="${BUILDDIR}/${DBREPORTERJAR}"/>
193 </java>
194 </target>
195
196 <!--
197 =====================================================
198 Javadoc
199 =====================================================
200 -->
201
202 <target name="javadoc" depends="config">
203 <mkdir dir="${JDOCDIR}"/>
204 <!-- link in here requires a live net link! -->
205 <javadoc
206 packagenames="${JDOCPKGS}"
207 destdir="${JDOCDIR}"
208 classpath="${JCCLASSPATH}"
209 author="true"
210 version="true"
211 private="true"
212 use="true"
213 windowtitle="${JDOCTITLE}"
214 header="${JDOCHEADER}"
215 bottom="${JDOCBOTTOM}"
216 link="${JDOCJAPI}"
217 >
218 <sourcepath>
219 <pathelement path="${SOURCEROOT}"/>
220 </sourcepath>
221 </javadoc>
222 </target>
223
224
225 <!--
226 =====================================================
227 Install
228 =====================================================
229 -->
230
231 <target name="install" depends="config, makejar">
232 <mkdir dir="${INSTALLDEST}"/>
233 <mkdir dir="${INSTALLDEST}/etc"/>
234 <mkdir dir="${INSTALLDEST}/lib"/>
235 <copy file="${BUILDDIR}/${DBREPORTERJAR}" todir="${INSTALLDEST}"/>
236 <copy file="${BUILDDIR}/run.sh" todir="${INSTALLDEST}"/>
237 <copy file="${BUILDDIR}/run.bat" todir="${INSTALLDEST}"/>
238 <copy todir="${INSTALLDEST}/lib" >
239 <fileset dir="${LIBDIR}">
240 <include name="**/*.jar"/>
241 <exclude name="**/CVS/*"/>
242 </fileset>
243 </copy>
244 <copy todir="${INSTALLDEST}/etc" >
245 <fileset dir="${BUILDDIR}/etc">
246 <include name="**/*"/>
247 <exclude name="**/CVS/*"/>
248 </fileset>
249 </copy>
250 <copy file="${BUILDDIR}/README" todir="${INSTALLDEST}"/>
251 </target>
252
253 <!--
254 =====================================================
255 CVS Build
256 =====================================================
257 -->
258
259 <target name="cvsbuild" depends="config">
260 <mkdir dir="${CVSBUILDTEMP}"/>
261 <cvs
262 cvsRoot="${CVSROOT}"
263 command="export -d ${CVSBUILDTEMP}"
264 tag="${REVISION}"
265 package="${CVSMODULE}"
266 />
267 <!-- it would be IDEAL to use the ant target here.
268 BUT, it would need to use it's OWN properties.
269 exec is a poor substitute.
270 no idea about windows compatibility. -->
271 <exec executable="ant" dir="${CVSBUILDTEMP}">
272 <arg value="fetch"/>
273 </exec>
274 <exec executable="ant" dir="${CVSBUILDTEMP}">
275 <arg value="package"/>
276 </exec>
277 <copy file="${CVSBUILDTEMP}/build/${TARGZFILE}"
278 tofile="${BUILDDIR}/${ARCNAME}-${REVISION}${TARGZEXT}"/>
279 <copy file="${CVSBUILDTEMP}/build/${ZIPFILE}"
280 tofile="${BUILDDIR}/${ARCNAME}-${REVISION}${ZIPEXT}"/>
281 <!-- should we be overwriting any old util jar here? -->
282 </target>
283
284 </project>