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 <!-- for libs installed by OS distribuitor -->
105 <fileset dir="/usr/share/java">
106 <include name="*.jar" />
110 <include name="*.jar"/>
112 <fileset dir="etc/extralib">
113 <include name="*.jar"/>
116 <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
118 <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
119 <fileset dir="${tomcat.home}">
120 <include name="lib/common/*.jar" />
122 <!-- for libs shared between webapps (tomcat 3.3.x) -->
123 <fileset dir="${tomcat.home}">
124 <include name="lib/apps/*.jar" />
126 <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
127 <fileset dir="${tomcat.home}">
128 <include name="common/lib/*.jar" />
130 <!-- for libs shared between webapps (tomcat 4.0.x) -->
131 <fileset dir="${tomcat.home}">
132 <include name="lib/*.jar" />
134 <!-- for libs shared between webapps (tomcat 4.1.x) -->
135 <fileset dir="${tomcat.home}">
136 <include name="shared/lib/*.jar" />
139 <fileset dir="${tomcat.home}">
140 <include name="common/endorsed/*.jar" />
145 <target name="prepare-compilation">
146 <mkdir dir="${build.classes}"/>
147 <mkdir dir="${build.jars}"/>
148 <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
149 <srcfiles dir="source" includes="**/*.java"/>
150 <srcfiles dir="lib" includes="*.jar"/>
151 <srcfiles dir="etc/extrasource" includes="**/*"/>
152 <srcfiles dir="etc/extralib" includes="*"/>
156 <!-- compile target: compiles all files into the build/classes dir -->
157 <target name="compile" depends="prepare-compilation" unless="up.to.date"
158 description="Creates the jars needed for a mir deployment">
160 <javac destdir="${build.classes}" debug="true" deprecation="off" source="1.3">
162 <src path="etc/extrasource"/>
163 <classpath refid="project.classpath"/>
166 <delete file="${build.jars}/mir.jar"/>
169 jarfile="${build.jars}/mir.jar">
170 <fileset dir="${build.classes}" includes="**/*.class" />
172 <attribute name="Built-By" value="${user.name}"/>
177 <!-- compile a debuggable version -->
178 <target name="compile-debug" depends="prepare-compilation">
179 <javac destdir="${build.classes}"
180 debug="on" optimize="off" deprecation="on">
182 <src path="etc/extrasource"/>
183 <classpath refid="project.classpath"/>
188 <!-- build the project's javadoc -->
189 <target name="javadoc" depends="prepare-javadoc">
191 destdir="${build.javadoc}"
195 packagenames="mir.*,mircoders.*"
197 sourcefiles="source/Mir.java,source/OpenMir.java"
200 <classpath refid="project.classpath"/>
201 <link href="http://java.sun.com/j2se/1.3/docs/api"/>
205 <target name="prepare-javadoc">
206 <mkdir dir="${build.javadoc}"/>
209 <target name="prepare-distribution">
210 <mkdir dir="${distribution.home}"/>
211 <delete dir="${build}/dist"/>
212 <mkdir dir="${build}/dist"/>
215 <target name="distribution" depends="prepare-distribution">
216 <antcall target="generate-deployment-tree">
217 <param name="destination" value="${build}/dist"/>
220 <tar tarfile="${distribution.home}/mir-${version}.tar.gz" compression="gzip">
221 <tarfileset dir="${build}/dist" includes="**/*" />
225 <target name="prepare-source-distribution">
226 <mkdir dir="${distribution.home}"/>
229 <target name="source-distribution" depends="prepare-source-distribution">
230 <!--<zip zipfile="${distribution.home}/mir-source-${version}.zip" >
232 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
234 <tar tarfile="${distribution.home}/mir-source-${version}.tar.gz" compression="gzip">
236 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
243 <target name="documentation-pdf" description="generates documentation into html form">
244 <xslt in="${temp}/docs/pdf/${document}.xml"
245 out="${temp}/docs/pdf/${document}.fo"
248 <java classname="org.apache.fop.apps.Fop" fork="yes">
251 <include name="*.jar"/>
256 <arg file="${temp}/docs/pdf/${document}.fo"/>
257 <arg file="${build}/pdfdocs/${document}.pdf"/>
261 <target name="prepare-html">
262 <mkdir dir="${build}/xslt"/>
264 <unzip dest="${build}/xslt" src="doc/lib/docbook-xsl-1.70.1.zip"/>
266 <copy todir="${build}/xslt">
267 <fileset dir="doc/style">
273 <target name="documentation-html" description="generates documentation into html form" depends="prepare-html">
274 <mkdir dir="${build}/htmldocs"/>
276 <xslt basedir="doc/installation" includes="*.xml"
277 destdir="${build}/htmldocs"
278 style="${build}/xslt/html.xsl"/>
281 <target name="full-distribution" depends="prepare-distribution,deploy,source-distribution">
282 <copy todir="${destination}/WEB-INF">
283 <fileset file="${distribution.home}/mir-source-${version}.tar.gz"/>
285 <tar tarfile="${distribution.home}/mir-${version}.tar.gz" compression="gzip">
286 <tarfileset dir="bin" includes="**/*" />