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 - gzipped tar version of the source tree
17 - Sets up a distributable version of mir in the
18 - form of a gzipped tar file with the sources
20 - Generates the project's javadoc
23 <property name="version" value="1.1.0rc0"/>
25 <property name="app.name" value="mir"/>
28 <property name="deploy.home" value="./bin/${app.name}"/>
30 <!-- The distribution will be built here: -->
31 <property name="distribution.home" value="./dist"/>
35 <!-- The temporary files made during the build process
36 will be created here: -->
37 <property name="build" value="./build"/>
38 <property name="build.classes" value="./${build}/classes"/>
39 <property name="build.jars" value="./${build}/jars"/>
40 <property name="build.javadoc" value="${build}/javadoc"/>
42 <!-- retrieve environment variables -->
43 <property environment="env"/>
45 <property name="tomcat.home" value="${env.TOMCAT_HOME}"/>
48 <property name="compile.optimize" value="off" />
49 <property name="compile.debug" value="on" />
52 <target name="deploy" depends="compile,generate-deployment-tree"
53 description="Sets up a deployment directory">
56 <target name="debug" depends="compile-debug,generate-deployment-tree"
57 description="Sets up a deployment directory with debug enabled">
60 <target name="generate-deployment-tree">
61 <property name="destination" value="${deploy.home}"/>
62 <mkdir dir="${destination}"/>
63 <mkdir dir="${destination}/WEB-INF"/>
64 <delete dir="${destination}/WEB-INF/lib"/>
65 <mkdir dir="${destination}/WEB-INF/lib"/>
66 <mkdir dir="${destination}/WEB-INF/log"/>
68 <copy todir="${destination}">
72 <copy todir="${destination}/WEB-INF/etc">
73 <fileset dir="etc" excludes="extrasource,extralib"/>
76 <copy todir="${destination}/WEB-INF">
80 <copy todir="${destination}/WEB-INF/templates">
81 <fileset dir="templates"/>
84 <copy todir="${destination}/WEB-INF/bundles">
85 <fileset dir="bundles"/>
88 <copy todir="${destination}/WEB-INF" file="source/default.properties" />
90 <copy todir="${destination}/WEB-INF/lib">
92 <fileset dir="etc/extralib" />
93 <fileset dir="${build.jars}" />
98 <delete dir="${build}"/>
101 <!-- Construct the classpath -->
102 <path id="project.classpath">
104 <include name="*.jar"/>
106 <fileset dir="etc/extralib">
107 <include name="*.jar"/>
110 <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
112 <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
113 <fileset dir="${tomcat.home}">
114 <include name="lib/common/*.jar" />
116 <!-- for libs shared between webapps (tomcat 3.3.x) -->
117 <fileset dir="${tomcat.home}">
118 <include name="lib/apps/*.jar" />
120 <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
121 <fileset dir="${tomcat.home}">
122 <include name="common/lib/*.jar" />
124 <!-- for libs shared between webapps (tomcat 4.0.x) -->
125 <fileset dir="${tomcat.home}">
126 <include name="lib/*.jar" />
128 <!-- for libs shared between webapps (tomcat 4.1.x) -->
129 <fileset dir="${tomcat.home}">
130 <include name="shared/lib/*.jar" />
133 <fileset dir="${tomcat.home}">
134 <include name="common/endorsed/*.jar" />
139 <target name="prepare-compilation">
140 <mkdir dir="${build.classes}"/>
141 <mkdir dir="${build.jars}"/>
142 <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
143 <srcfiles dir="source" includes="**/*.java"/>
144 <srcfiles dir="lib" includes="*.jar"/>
145 <srcfiles dir="etc/extrasource" includes="**/*"/>
146 <srcfiles dir="etc/extralib" includes="*"/>
150 <!-- compile target: compiles all files into the build/classes dir -->
151 <target name="compile" depends="prepare-compilation" unless="up.to.date"
152 description="Creates the jars needed for a mir deployment">
154 <javac destdir="${build.classes}" debug="true" deprecation="off" source="1.3">
156 <src path="etc/extrasource"/>
157 <classpath refid="project.classpath"/>
160 <delete file="${build.jars}/mir.jar"/>
163 jarfile="${build.jars}/mir.jar">
164 <fileset dir="${build.classes}" includes="**/*.class" />
166 <attribute name="Built-By" value="${user.name}"/>
171 <!-- compile a debuggable version -->
172 <target name="compile-debug" depends="prepare-compilation">
173 <javac destdir="${build.classes}"
174 debug="on" optimize="off" deprecation="on">
176 <src path="etc/extrasource"/>
177 <classpath refid="project.classpath"/>
182 <!-- build the project's javadoc -->
183 <target name="javadoc" depends="prepare-javadoc">
185 destdir="${build.javadoc}"
189 packagenames="mir.*,mircoders.*"
191 sourcefiles="source/Mir.java,source/OpenMir.java"
194 <classpath refid="project.classpath"/>
195 <link href="http://java.sun.com/j2se/1.3/docs/api"/>
199 <target name="prepare-javadoc">
200 <mkdir dir="${build.javadoc}"/>
203 <target name="prepare-distribution">
204 <mkdir dir="${distribution.home}"/>
205 <delete dir="${build}/dist"/>
206 <mkdir dir="${build}/dist"/>
209 <target name="distribution" depends="prepare-distribution">
210 <antcall target="generate-deployment-tree">
211 <param name="destination" value="${build}/dist"/>
214 <tar tarfile="${distribution.home}/mir-${version}.tar.gz" compression="gzip">
215 <tarfileset dir="${build}/dist" includes="**/*" />
219 <target name="prepare-source-distribution">
220 <mkdir dir="${distribution.home}"/>
223 <target name="source-distribution" depends="prepare-source-distribution">
224 <!--<zip zipfile="${distribution.home}/mir-source-${version}.zip" >
226 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
228 <tar tarfile="${distribution.home}/mir-source-${version}.tar.gz" compression="gzip">
230 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
237 <target name="documentation-pdf" description="generates documentation into html form">
238 <xslt in="${temp}/docs/pdf/${document}.xml"
239 out="${temp}/docs/pdf/${document}.fo"
242 <java classname="org.apache.fop.apps.Fop" fork="yes">
245 <include name="*.jar"/>
250 <arg file="${temp}/docs/pdf/${document}.fo"/>
251 <arg file="${build}/pdfdocs/${document}.pdf"/>
255 <target name="prepare-html">
256 <mkdir dir="${build}/xslt"/>
258 <unzip dest="${build}/xslt" src="doc/lib/docbook-xsl-1.70.1.zip"/>
260 <copy todir="${build}/xslt">
261 <fileset dir="doc/style">
267 <target name="documentation-html" description="generates documentation into html form" depends="prepare-html">
268 <mkdir dir="${build}/htmldocs"/>
270 <xslt basedir="doc/installation" includes="*.xml"
271 destdir="${build}/htmldocs"
272 style="${build}/xslt/html.xsl"/>
275 <target name="full-distribution" depends="prepare-distribution,deploy,source-distribution">
276 <copy todir="${destination}/WEB-INF">
277 <fileset file="${distribution.home}/mir-source-${version}.tar.gz"/>
279 <tar tarfile="${distribution.home}/mir-${version}.tar.gz" compression="gzip">
280 <tarfileset dir="bin" includes="**/*" />