added back in Producer.Content.Batchsize
[mir.git] / build.xml-new
1 <project name="Mir" default="compile" basedir=".">
2
3
4 <!-- What this file is all about
5      
6      You can use this version of build.xml to use directly with ant
7      i.e. without the build.sh script. Simply call ant and let it all
8      happen.
9 -->
10
11 <!-- Property Definitions
12      app.name          Base name of this application, used to
13                        construct filenames and directories.
14
15      deploy.home       The name of the directory into which the
16                        deployment hierarchy will be created.
17                        Normally, this will be the name of a
18                        subdirectory under $TOMCAT_HOME/webapps.
19
20      dist.home         The name of the base directory in which
21                        distribution files are created.
22
23      dist.src          The name of the distribution JAR file
24                        containing the application source code,
25                        to be stored in the "dist.home" directory.
26                        This filename should end with ".jar".
27
28      dist.war          The name of the Web ARchive (WAR) file
29                        containing our deployable application.
30                        This filename should end with ".war".
31
32      javadoc.home      The name of the base directory in which
33                        the JavaDoc documentation for this application
34                        is generated.
35
36      tomcat.home       The name of the base directory in which
37                        Tomcat has been installed.  This value is
38                        normally set automatically from the value
39                        of the TOMCAT_HOME environment variable.
40
41         java.home          The location of your Java SDK.
42
43         java.localhome     Where your local java classes and jar files 
44                        are located.
45
46         tomcat.home        The location of the tomcat root directory.
47
48 -->
49
50   <property name="app.name"       value="Mir"/>
51   <property name="deploy.home"    value="../${app.name}"/>
52   <property name="dist.home"      value="${deploy.home}"/>
53   <property name="dist.src"       value="${app.name}.jar"/>
54   <property name="dist.war"       value="${app.name}.war"/>
55   <property name="javadoc.home"   value="${deploy.home}/javadoc"/>
56
57   <property name="java.home"      value="/usr/lib/j2sdk1.3/"/>
58   <property name="java.localhome" value="/usr/share/java/"/>
59   <property name="tomcat.home"    value="/usr/share/tomcat/"/>
60
61
62   <!-- Construct the classpath -->
63   <path id="project.class.path">
64     <pathelement path="${deploy.home}"/>
65     <pathelement path="${deploy.home}/WEB-INF/classes"/>
66     <pathelement path="source"/>
67     <fileset dir="lib">
68       <include name="*.jar"/>
69     </fileset>
70     <fileset dir="${java.home}/lib">
71       <include name="tools.jar"/>
72       <include name="rt.jar"/>
73     </fileset>
74     <fileset dir="${java.localhome}">
75       <include name="*.jar"/>
76     </fileset>
77     <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
78   </path>
79
80
81
82 <!-- The "prepare" target is used to construct the deployment home
83      directory structure (if necessary), and to copy in static files
84      as required.  In the example below, Ant is instructed to create
85      the deployment directory, copy the contents of the "web/" source
86      hierarchy, and set up the WEB-INF subdirectory appropriately.
87 -->
88
89   <target name="prepare">
90     <mkdir  dir="${deploy.home}"/>
91     <copy todir="${deploy.home}">
92       <fileset dir="web"/>
93     </copy>
94     <mkdir  dir="${deploy.home}/templates"/>
95     <copy todir="${deploy.home}/templates">
96       <fileset dir="templates"/>
97     </copy>
98     <mkdir  dir="${deploy.home}/src"/>
99     <copy todir="${deploy.home}/src">
100       <fileset dir="source"/>
101     </copy>
102
103     <mkdir  dir="${deploy.home}/WEB-INF"/>
104     <copy  file="etc/web.xml"          tofile="${deploy.home}/WEB-INF/web.xml"/>
105     <mkdir  dir="${deploy.home}/WEB-INF/classes"/>
106     <mkdir  dir="${deploy.home}/WEB-INF/lib"/>
107     <copy todir="${deploy.home}/WEB-INF/lib">
108       <fileset dir="lib">
109         <exclude name="ant.jar"/>
110         <exclude name="xerces.jar"/>
111       </fileset>
112     </copy>
113     <mkdir  dir="${javadoc.home}"/>
114     <mkdir  dir="${deploy.home}/log"/>
115
116   </target>
117
118
119 <!-- The "clean" target removes the deployment home directory structure,
120      so that the next time the "compile" target is requested, it will need
121      to compile everything from scratch.
122 -->
123
124
125   <target name="clean">
126     <delete dir="${deploy.home}"/>
127   </target>
128
129
130 <!-- The "compile" target is used to compile (or recompile) the Java classes
131      that make up this web application.  The recommended source code directory
132      structure makes this very easy because the <javac> task automatically
133      works its way down a source code hierarchy and compiles any class that
134      has not yet been compiled, or where the source file is newer than the
135      class file.
136
137      Feel free to adjust the compilation option parameters (debug,
138      optimize, and deprecation) to suit your requirements.  It is also
139      possible to base them on properties, so that you can adjust this
140      behavior at runtime.
141
142      The "compile" task depends on the "prepare" task, so the deployment
143      home directory structure will be created if needed the first time.
144 -->
145
146   <target name="compile" depends="prepare">
147     <javac srcdir="source" destdir="${deploy.home}/WEB-INF/classes"
148            debug="on" optimize="off" deprecation="on">
149       <classpath refid="project.class.path"/>
150         </javac>
151     <copy   todir="${deploy.home}/WEB-INF/classes">
152       <fileset dir="source" includes="**/*.properties"/>
153     </copy>
154     <copy   todir="${deploy.home}">
155       <fileset dir="source" includes="**/content-types.properties"/>
156     </copy>
157         <echo>
158                 Now you should call perms.sh(-dist) in order to set
159                 the permissions of your installed files to a meaningful
160                 value. 
161                 Have fun with Mir!
162         </echo>
163   </target>
164
165
166 <!-- The "javadoc" target is used to create the Javadoc API documentation
167      for the Java classes in this web application.  It is assumed that
168      this documentation is included in the deployed application, so the
169      example below generates the Javadoc HTML files in a subdirectory under
170      the deployment home directory.  Feel free to customize the options for
171      the JavaDoc task, after consulting the Ant documentation.
172 -->
173
174   <target name="javadoc" depends="prepare">
175     <javadoc packagenames="mir.*, mircoders.*"
176              sourcefiles="source/${app.name}.java,source/Open${app.name}.java"
177              sourcepath="source"
178              destdir="${javadoc.home}">
179           <classpath refid="project.class.path"/>
180         </javadoc>
181   </target>
182
183
184 <!-- The "all" target rebuilds everything by executing the "clean"
185      target first, which forces the "compile" target to compile all
186      source code instead of just the files that have been changed.
187 -->
188
189   <target name="all" depends="clean,prepare,compile,javadoc"/>
190
191
192 <!-- The "dist" target builds the distribution Web ARchive (WAR) file
193      for this application, suitable for distribution to sites that wish
194      to install your application.  It also creates a JAR file containing
195      the source code for this application, if you wish to distribute
196      that separately.
197 -->
198   <target name="dist" depends="prepare,compile">
199     <jar jarfile="mirbase.jar"
200          includes="mir/**"
201          basedir="../Mir/WEB-INF/classes"/>
202     <jar jarfile="${dist.src}"
203          basedir="./source"/>
204     <jar jarfile="${dist.war}"
205          basedir="${deploy.home}"/>
206   </target>
207
208 </project>