ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/build.xml
(Generate patch)

Comparing projects/cms/source/server/build.xml (file contents):
Revision 1.2 by tdb, Mon May 14 02:43:23 2001 UTC vs.
Revision 1.13 by tdb, Thu Feb 7 17:15:18 2002 UTC

# Line 1 | Line 1
1 < <!-- build file for server -->
2 < <project name="iscream-server" default="package">
1 > <!-- build file for i-scream CMS server -->
2 > <!-- $Id$ -->
3 >
4 > <project name="iscream-server" default="usage">
5    
4  <!--
5    TODO:
6      build/jar util package
7      install target
8      cvs version build (including cleanup)
9      javadoc
10      sql table generation
11  -->
12  
6    <!--
7      =====================================================
8        Initialisation & Configuration
# Line 26 | Line 19
19    
20    <!--
21      =====================================================
22 <      Main targets (shortcuts essentially)
22 >      Usage
23      =====================================================
24    -->
25    
26 <  <target name="fetch">
27 <    <antcall target="getlibs"/>
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 >     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 >    
38 >     cvsbuild     - build from cvs tag
39 >                      use -Drev=TAG switch to specify cvs tag
40 >    
41 >     javadoc      - generate javadoc API
42 >     install      - install server
43 >                      use -Dprefix=/path/ switch to specify dest
44 >     run          - run the server
45 >    
46 >     clean        - clean all generated files
47 >     distclean    - remove 'fetched' libraries + clean
48 >    
49 >     Recommend to run the following target order:
50 >    
51 >     fetch packageutil package javadoc install
52 >    </echo>
53    </target>
54    
55 <  <target name="idl">
56 <    <antcall target="genidl"/>
55 >  <target name="help">
56 >    <antcall target="usage"/>
57    </target>
58    
41  <target name="build">
42    <antcall target="compile"/>
43  </target>
44  
45  <target name="package">
46    <antcall target="makedist"/>
47  </target>
48  
49  <target name="run">
50    <antcall target="runserver"/>
51  </target>
52  
53  <target name="clean">
54    <antcall target="cleanup"/>
55  </target>
56  
57  <target name="distclean">
58    <antcall target="fullcleanup"/>
59  </target>
60  
59    <!--
60      =====================================================
61        Fetch required libraries (not in dependency tree)
# Line 65 | Line 63
63    -->
64    
65    <!-- this uses static names, which is messy -->
66 <  <!-- fullcleanup target has same problem -->
67 <  <target name="getlibs" depends="config">
66 >  <!-- distclean target has same problem -->
67 >  <target name="fetch" depends="config">
68      <get
69 <      src="http://killigrew.ukc.ac.uk/crimson.jar"
69 >      src="${LIBURL}/crimson.jar"
70        dest="${LIBDIR}/crimson.jar"
71        verbose="true" usetimestamp="true"
72      />
73      <get
74 <      src="http://killigrew.ukc.ac.uk/idl.jar"
74 >      src="${LIBURL}/idl.jar"
75        dest="${LIBDIR}/idl.jar"
76        verbose="true" usetimestamp="true"
77      />
78      <get
79 <      src="http://killigrew.ukc.ac.uk/jacorb.jar"
79 >      src="${LIBURL}/jacorb.jar"
80        dest="${LIBDIR}/jacorb.jar"
81        verbose="true" usetimestamp="true"
82      />
83      <get
84 <      src="http://killigrew.ukc.ac.uk/jaxp.jar"
84 >      src="${LIBURL}/jaxp.jar"
85        dest="${LIBDIR}/jaxp.jar"
86        verbose="true" usetimestamp="true"
87      />
88      <get
89 <      src="http://killigrew.ukc.ac.uk/mm.mysql-2.0.4-bin.jar"
90 <      dest="${LIBDIR}/mm.mysql-2.0.4-bin.jar"
89 >      src="${LIBURL}/mm.mysql-2.0.11-bin.jar"
90 >      dest="${LIBDIR}/mm.mysql-2.0.11-bin.jar"
91        verbose="true" usetimestamp="true"
92      />
93 +    <get
94 +      src="${LIBURL}/pircbot.jar"
95 +      dest="${LIBDIR}/pircbot.jar"
96 +      verbose="true" usetimestamp="true"
97 +    />
98      <!-- also get jacorb.properties? -->
99    </target>
100    
# Line 102 | Line 105
105    -->
106    
107    <!-- generate java code from idl files -->
108 <  <target name="genidl" depends="config">
108 >  <target name="idl" depends="config">
109      <echo message="Generating Java source from IDL"/>
110      <java classname="${IDLPARSER}">
111 <      <arg line="-d ${IDLDIR} ${IDLFILE}"/>
111 >      <arg line="-sloppy_names -d ${IDLDIR} ${IDLFILE}"/>
112        <classpath path="${IDLPARSERJAR}"/>
113      </java>
114    </target>
# Line 116 | Line 119
119      =====================================================
120    -->
121  
122 <  <target name="compileidl" depends="genidl">
122 >  <target name="buildidl" depends="idl">
123      <javac
124        srcdir="${IDLDIR}"
125        destdir="${BUILDDIR}"
# Line 128 | Line 131
131      />
132    </target>
133    
134 <  <target name="compile" depends="compileidl">
134 >  <target name="build" depends="buildidl">
135      <javac
136        srcdir="${SOURCEROOT}"
137        destdir="${BUILDDIR}"
# Line 146 | Line 149
149      =====================================================
150    -->
151    
152 <  <target name="makejar" depends="compile">
152 >  <target name="makejar" depends="build">
153      <echo file="${BUILDDIR}/MANIFEST_TMP"
154   >Manifest-Version: 1.0
155   Created-By: www.i-scream.org.uk
# Line 181 | Line 184 | Class-Path: ${MFCLPATH}
184      />
185    </target>
186    
187 <  <target name="makedist" depends="maketardist, makezipdist"/>
187 >  <target name="package" depends="maketardist, makezipdist"/>
188    
189    <!--
190      =====================================================
# Line 189 | Line 192 | Class-Path: ${MFCLPATH}
192      =====================================================
193    -->
194    
195 <  <target name="cleanup" depends="config">
195 >  <target name="clean" depends="config">
196      <delete dir="${IDLDIR}/${ROOTPKG}"/>
197      <delete dir="${BUILDDIR}/${ROOTPKG}"/>
198 <    <delete file="${BUILDDIR}/${SERVERJAR}"/>
199 <    <delete file="${BUILDDIR}/${TARFILE}"/>
200 <    <delete file="${BUILDDIR}/${TARGZFILE}"/>
201 <    <delete file="${BUILDDIR}/${ZIPFILE}"/>
198 >    <delete dir="${JDOCDIR}"/>
199 >    <delete dir="${CVSBUILDTEMP}"/>
200 >    <delete>
201 >      <fileset dir="${BUILDDIR}">
202 >        <include name="${SERVERJAR}"/>
203 >        <include name="${UTILJAR}"/>
204 >        <include name="${ARCNAME}*${TAREXT}"/>
205 >        <include name="${ARCNAME}*${TARGZEXT}"/>
206 >        <include name="${ARCNAME}*${ZIPEXT}"/>
207 >      </fileset>
208 >    </delete>
209    </target>
210    
211 <  <target name="fullcleanup" depends="cleanup">
211 >  <target name="distclean" depends="clean">
212      <!-- this is messy, we should only delete specific jars -->
213      <delete>
214        <fileset dir="${LIBDIR}" includes="*.jar"/>
# Line 207 | Line 217 | Class-Path: ${MFCLPATH}
217    
218    <!--
219      =====================================================
220 <      Running (not in dependency tree)
220 >      Running
221      =====================================================
222    -->
223    
224 <  <!-- is this really the best way to do this? -->
225 <  <target name="runserver" depends="config">
224 >  <!-- is this really the best way to do this? no... -->
225 >  <target name="run" depends="config">
226      <java classname="${MFMAINCLASS}" dir="${BUILDDIR}" fork="yes">
227        <arg line="-f ${RUNFILTERNAME}"/>
228        <classpath path="${BUILDDIR}/${SERVERJAR}"/>
229      </java>
230 +  </target>
231 +  
232 +  <!--
233 +    =====================================================
234 +      Javadoc
235 +    =====================================================
236 +  -->
237 +  
238 +  <target name="javadoc" depends="config, idl">
239 +    <mkdir dir="${JDOCDIR}"/>
240 +    <!-- link in here requires a live net link! -->
241 +    <javadoc
242 +      packagenames="${JDOCPKGS}"
243 +      destdir="${JDOCDIR}"
244 +      classpath="${JCCLASSPATH}"
245 +      author="true"
246 +      version="true"
247 +      private="true"
248 +      use="true"
249 +      windowtitle="${JDOCTITLE}"
250 +      header="${JDOCHEADER}"
251 +      bottom="${JDOCBOTTOM}"
252 +      link="${JDOCJAPI}"
253 +    >
254 +      <!-- need to do idl generated source too -->
255 +      <sourcepath>
256 +        <pathelement path="${SOURCEROOT}"/>
257 +        <pathelement path="${IDLDIR}"/>
258 +      </sourcepath>
259 +    </javadoc>
260 +  </target>
261 +  
262 +  <!--
263 +    =====================================================
264 +      Util Package
265 +    =====================================================
266 +  -->
267 +  
268 +  <!-- MUST clean here to ensure util package is tidy -->
269 +  <target name="buildutil" depends="config, clean">
270 +    <javac
271 +      srcdir="${SOURCEROOT}"
272 +      destdir="${BUILDDIR}"
273 +      classpath="${JCCLASSPATH}"
274 +      includes="${UTILSRC}"
275 +      debug="${JCDEBUG}"
276 +      optimize="${JCOPTIM}"
277 +      deprecation="${JCDEPRE}"
278 +    />
279 +  </target>
280 +  
281 +  <target name="packageutil" depends="buildutil">
282 +    <jar
283 +      jarfile="${BUILDDIR}/${UTILJAR}"
284 +      basedir="${BUILDDIR}"
285 +      includes="uk/**/*.class"
286 +    />
287 +  </target>
288 +  
289 +  <!--
290 +    =====================================================
291 +      Install
292 +    =====================================================
293 +  -->
294 +  
295 +  <target name="install" depends="config, makejar">
296 +    <mkdir dir="${INSTALLDEST}"/>
297 +    <mkdir dir="${INSTALLDEST}/etc"/>
298 +    <mkdir dir="${INSTALLDEST}/lib"/>
299 +    <copy file="${BUILDDIR}/${SERVERJAR}" todir="${INSTALLDEST}"/>
300 +    <copy file="${BUILDDIR}/run.sh" todir="${INSTALLDEST}"/>
301 +    <copy file="${BUILDDIR}/run.bat" todir="${INSTALLDEST}"/>
302 +    <copy todir="${INSTALLDEST}/lib" >
303 +      <fileset dir="${LIBDIR}">
304 +        <include name="**/*.jar"/>
305 +        <exclude name="**/CVS/*"/>
306 +      </fileset>
307 +    </copy>
308 +    <copy todir="${INSTALLDEST}/etc" >
309 +      <fileset dir="${BUILDDIR}/etc">
310 +        <include name="**/*"/>
311 +        <exclude name="**/CVS/*"/>
312 +      </fileset>
313 +    </copy>
314 +    <copy file="${BUILDDIR}/README" todir="${INSTALLDEST}"/>
315 +  </target>
316 +  
317 +  <!--
318 +    =====================================================
319 +      CVS Build
320 +    =====================================================
321 +  -->
322 +  
323 +  <target name="cvsbuild" depends="config">
324 +    <mkdir dir="${CVSBUILDTEMP}"/>
325 +    <cvs
326 +      cvsRoot="${CVSROOT}"
327 +      command="export -d ${CVSBUILDTEMP}"
328 +      tag="${REVISION}"
329 +      package="${CVSMODULE}"
330 +    />
331 +    <!-- it would be IDEAL to use the ant target here.
332 +         BUT, it would need to use it's OWN properties.
333 +         exec is a poor substitute.
334 +         no idea about windows compatibility. -->
335 +    <exec executable="ant" dir="${CVSBUILDTEMP}">
336 +      <arg value="fetch"/>
337 +    </exec>
338 +    <exec executable="ant" dir="${CVSBUILDTEMP}">
339 +      <arg value="packageutil"/>
340 +    </exec>
341 +    <exec executable="ant" dir="${CVSBUILDTEMP}">
342 +      <arg value="package"/>
343 +    </exec>
344 +    <copy file="${CVSBUILDTEMP}/build/${TARGZFILE}"
345 +          tofile="${BUILDDIR}/${ARCNAME}-${REVISION}${TARGZEXT}"/>
346 +    <copy file="${CVSBUILDTEMP}/build/${ZIPFILE}"
347 +          tofile="${BUILDDIR}/${ARCNAME}-${REVISION}${ZIPEXT}"/>
348 +    <!-- should we be overwriting any old util jar here? -->
349 +    <copy file="${CVSBUILDTEMP}/build/${UTILJAR}" todir="${BUILDDIR}"/>
350    </target>
351    
352   </project>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines