ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/build.xml
Revision: 1.8
Committed: Fri May 18 02:12:33 2001 UTC (23 years, 6 months ago) by tdb
Content type: text/xml
Branch: MAIN
Changes since 1.7: +54 -11 lines
Log Message:
cvsbuild target added :) It's a touch crude due to the way ANT works. In fact,
it's the first thing that's been done "outside" of the ANT environment. I may
submit a feature request on this one, if possible.

This leaves the build setup here complete. Still some tidying up to do, very
much so in the configuration file. Probably a few bugs too, but all the features
covered by the Makefile setup (including configure) are included.

Also need to adjust documentation accordingly.

File Contents

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