ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/build.xml
Revision: 1.10
Committed: Tue May 29 17:02:24 2001 UTC (23 years, 6 months ago) by tdb
Content type: text/xml
Branch: MAIN
Changes since 1.9: +2 -2 lines
Log Message:
Major change in the java package naming. This has been held off for some time
now, but it really needed doing. The future packaging of all i-scream products
will be;

uk.org.iscream.<product>.<subpart>.*

In the case of the central monitoring system server this will be;

uk.org.iscream.cms.server.*

The whole server has been changed to follow this structure, and tested to a
smallish extent. Further changes in other parts of the CMS will follow.

File Contents

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