ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/build.xml
Revision: 1.7
Committed: Fri May 18 01:32:15 2001 UTC (23 years, 5 months ago) by tdb
Content type: text/xml
Branch: MAIN
Changes since 1.6: +30 -3 lines
Log Message:
Install target now completed. Only task left to complete to bring this ANT build
script in line with the current Makefile is the "cvsbuild". This is somewhat
more involved though.

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