1 <project name="Mir" default="deploy" basedir=".">
3 - Build script for the Mir project
7 - Creates the jars needed for a mir deployment
9 - Sets up a deployment directory
10 - * binary-distribution
11 - Sets up a distributable version of mir in the
13 - * source-distribution
14 - Sets up a distributable version of mir as a
15 - zipped version of the source tree
17 - Generates the project's javadoc
20 <property name="version" value="1.1.0rc0"/>
22 <property name="app.name" value="mir"/>
25 <property name="deploy.home" value="./bin/${app.name}"/>
27 <!-- The distribution will be built here: -->
28 <property name="distribution.home" value="./dist"/>
32 <!-- The temporary files made during the build process
33 will be created here: -->
34 <property name="build.home" value="./build"/>
35 <property name="build.classes" value="./${build.home}/classes"/>
36 <property name="build.jars" value="./${build.home}/jars"/>
37 <property name="build.javadoc" value="${build.home}/javadoc"/>
39 <!-- retrieve environment variables -->
40 <property environment="env"/>
42 <property name="deploy.webinf" value="${deploy.home}/WEB-INF"/>
43 <property name="deploy.classes" value="${deploy.webinf}/classes"/>
45 <property name="dist.src" value="${app.name}.jar"/>
46 <property name="dist.war" value="${app.name}.war"/>
48 <property name="tomcat.home" value="${env.TOMCAT_HOME}"/>
51 <property name="compile.optimize" value="off" />
52 <property name="compile.debug" value="on" />
55 <target name="deploy" depends="compile,generate-deployment-tree"
56 description="Sets up a deployment directory">
59 <target name="debug" depends="compile-debug,generate-deployment-tree"
60 description="Sets up a deployment directory with debug enabled">
64 <target name="generate-deployment-tree">
65 <property name="destination" value="${deploy.home}"/>
66 <mkdir dir="${destination}"/>
67 <mkdir dir="${destination}/WEB-INF"/>
68 <delete dir="${destination}/WEB-INF/lib"/>
69 <mkdir dir="${destination}/WEB-INF/lib"/>
70 <mkdir dir="${destination}/WEB-INF/log"/>
72 <copy todir="${destination}">
76 <copy todir="${destination}/WEB-INF/etc">
77 <fileset dir="etc" excludes="extrasource,extralib"/>
80 <copy todir="${destination}/WEB-INF">
84 <copy todir="${destination}/WEB-INF/templates">
85 <fileset dir="templates"/>
88 <copy todir="${destination}/WEB-INF/bundles">
89 <fileset dir="bundles"/>
92 <copy todir="${destination}/WEB-INF" file="source/default.properties" />
94 <copy todir="${destination}/WEB-INF/lib">
96 <fileset dir="etc/extralib" />
97 <fileset dir="${build.jars}" />
101 <target name="clean">
102 <delete dir="${build.home}"/>
105 <!-- Construct the classpath -->
106 <path id="project.classpath">
108 <include name="*.jar"/>
110 <fileset dir="etc/extralib">
111 <include name="*.jar"/>
114 <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
116 <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
117 <fileset dir="${tomcat.home}">
118 <include name="lib/common/*.jar" />
120 <!-- for libs shared between webapps (tomcat 3.3.x) -->
121 <fileset dir="${tomcat.home}">
122 <include name="lib/apps/*.jar" />
124 <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
125 <fileset dir="${tomcat.home}">
126 <include name="common/lib/*.jar" />
128 <!-- for libs shared between webapps (tomcat 4.0.x) -->
129 <fileset dir="${tomcat.home}">
130 <include name="lib/*.jar" />
132 <!-- for libs shared between webapps (tomcat 4.1.x) -->
133 <fileset dir="${tomcat.home}">
134 <include name="shared/lib/*.jar" />
137 <fileset dir="${tomcat.home}">
138 <include name="common/endorsed/*.jar" />
143 <target name="prepare-compilation">
144 <mkdir dir="${build.classes}"/>
145 <mkdir dir="${build.jars}"/>
146 <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
147 <srcfiles dir="source" includes="**/*.java"/>
148 <srcfiles dir="lib" includes="*.jar"/>
149 <srcfiles dir="etc/extrasource" includes="**/*"/>
150 <srcfiles dir="etc/extralib" includes="*"/>
154 <!-- compile target: compiles all files into the build/classes dir -->
155 <target name="compile" depends="prepare-compilation" unless="up.to.date"
156 description="Creates the jars needed for a mir deployment">
158 <javac destdir="${build.classes}" deprecation="on">
160 <src path="etc/extrasource"/>
161 <classpath refid="project.classpath"/>
165 jarfile="${build.jars}/mir.jar">
166 <fileset dir="${build.classes}" includes="**/*.class" />
168 <attribute name="Built-By" value="${user.name}"/>
173 <!-- compile a debuggable version -->
174 <target name="compile-debug" depends="prepare-compilation">
175 <javac destdir="${build.classes}"
176 debug="on" optimize="off" deprecation="on">
178 <src path="etc/extrasource"/>
179 <classpath refid="project.classpath"/>
184 <!-- build the project's javadoc -->
185 <target name="javadoc" depends="prepare-javadoc">
187 destdir="${build.javadoc}"
191 packagenames="mir.*,mircoders.*"
193 sourcefiles="source/Mir.java,source/OpenMir.java"
196 <classpath refid="project.classpath"/>
197 <link href="http://java.sun.com/j2se/1.3/docs/api"/>
201 <target name="prepare-javadoc">
202 <mkdir dir="${build.javadoc}"/>
205 <target name="prepare-binary-distribution">
206 <mkdir dir="${distribution.home}"/>
207 <delete dir="${build.home}/binarydist"/>
208 <mkdir dir="${build.home}/binarydist"/>
211 <target name="binary-distribution" depends="prepare-binary-distribution">
212 <antcall target="generate-deployment-tree">
213 <param name="destination" value="${build.home}/binarydist"/>
216 <zip zipfile="${distribution.home}/binary.zip" >
217 <fileset dir="${build.home}/binarydist" includes="**/*" />
221 <target name="prepare-source-distribution">
222 <mkdir dir="${distribution.home}"/>
225 <target name="source-distribution" depends="prepare-source-distribution">
226 <zip zipfile="${distribution.home}/source.zip" >
228 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />