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}"/>
46 <property name="user.classpath" value="${env.CLASSPATH}"/>
49 <property name="compile.optimize" value="off" />
50 <property name="compile.debug" value="on" />
53 <target name="deploy" depends="compile,generate-deployment-tree"
54 description="Sets up a deployment directory">
57 <target name="debug" depends="compile-debug,generate-deployment-tree"
58 description="Sets up a deployment directory with debug enabled">
61 <target name="generate-deployment-tree">
62 <property name="destination" value="${deploy.home}"/>
63 <mkdir dir="${destination}"/>
64 <mkdir dir="${destination}/WEB-INF"/>
65 <delete dir="${destination}/WEB-INF/lib"/>
66 <mkdir dir="${destination}/WEB-INF/lib"/>
67 <mkdir dir="${destination}/WEB-INF/log"/>
69 <copy todir="${destination}">
73 <copy todir="${destination}/WEB-INF/etc">
74 <fileset dir="etc" excludes="extrasource,extralib"/>
77 <copy todir="${destination}/WEB-INF">
81 <copy todir="${destination}/WEB-INF/templates">
82 <fileset dir="templates"/>
85 <copy todir="${destination}/WEB-INF/bundles">
86 <fileset dir="bundles"/>
89 <copy todir="${destination}/WEB-INF" file="source/default.properties" />
91 <copy todir="${destination}/WEB-INF/lib">
93 <fileset dir="etc/extralib" />
94 <fileset dir="${build.jars}" />
99 <delete dir="${build}"/>
102 <!-- Construct the classpath -->
103 <path id="project.classpath">
105 <!-- for libs installed by user or OS distribuitor -->
106 <fileset dir="${user.classpath}">
107 <include name="*.jar" />
111 <include name="*.jar"/>
113 <fileset dir="etc/extralib">
114 <include name="*.jar"/>
117 <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
119 <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
120 <fileset dir="${tomcat.home}">
121 <include name="lib/common/*.jar" />
123 <!-- for libs shared between webapps (tomcat 3.3.x) -->
124 <fileset dir="${tomcat.home}">
125 <include name="lib/apps/*.jar" />
127 <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
128 <fileset dir="${tomcat.home}">
129 <include name="common/lib/*.jar" />
131 <!-- for libs shared between webapps (tomcat 4.0.x) -->
132 <fileset dir="${tomcat.home}">
133 <include name="lib/*.jar" />
135 <!-- for libs shared between webapps (tomcat 4.1.x) -->
136 <fileset dir="${tomcat.home}">
137 <include name="shared/lib/*.jar" />
140 <fileset dir="${tomcat.home}">
141 <include name="common/endorsed/*.jar" />
146 <target name="prepare-compilation">
147 <mkdir dir="${build.classes}"/>
148 <mkdir dir="${build.jars}"/>
149 <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
150 <srcfiles dir="source" includes="**/*.java"/>
151 <srcfiles dir="lib" includes="*.jar"/>
152 <srcfiles dir="etc/extrasource" includes="**/*"/>
153 <srcfiles dir="etc/extralib" includes="*"/>
157 <!-- compile target: compiles all files into the build/classes dir -->
158 <target name="compile" depends="prepare-compilation" unless="up.to.date"
159 description="Creates the jars needed for a mir deployment">
161 <javac destdir="${build.classes}" debug="true" deprecation="off" source="1.3">
163 <src path="etc/extrasource"/>
164 <classpath refid="project.classpath"/>
167 <delete file="${build.jars}/mir.jar"/>
170 jarfile="${build.jars}/mir.jar">
171 <fileset dir="${build.classes}" includes="**/*.class" />
173 <attribute name="Built-By" value="${user.name}"/>
178 <!-- compile a debuggable version -->
179 <target name="compile-debug" depends="prepare-compilation">
180 <javac destdir="${build.classes}"
181 debug="on" optimize="off" deprecation="on">
183 <src path="etc/extrasource"/>
184 <classpath refid="project.classpath"/>
189 <!-- build the project's javadoc -->
190 <target name="javadoc" depends="prepare-javadoc">
192 destdir="${build.javadoc}"
196 packagenames="mir.*,mircoders.*"
198 sourcefiles="source/Mir.java,source/OpenMir.java"
201 <classpath refid="project.classpath"/>
202 <link href="http://java.sun.com/j2se/1.3/docs/api"/>
206 <target name="prepare-javadoc">
207 <mkdir dir="${build.javadoc}"/>
210 <target name="prepare-distribution">
211 <mkdir dir="${distribution.home}"/>
212 <delete dir="${build}/dist"/>
213 <mkdir dir="${build}/dist"/>
216 <target name="distribution" depends="prepare-distribution">
217 <antcall target="generate-deployment-tree">
218 <param name="destination" value="${build}/dist"/>
221 <tar tarfile="${distribution.home}/mir-${version}.tar.gz" compression="gzip">
222 <tarfileset dir="${build}/dist" includes="**/*" />
226 <target name="prepare-source-distribution">
227 <mkdir dir="${distribution.home}"/>
230 <target name="source-distribution" depends="prepare-source-distribution">
231 <!--<zip zipfile="${distribution.home}/mir-source-${version}.zip" >
233 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
235 <tar tarfile="${distribution.home}/mir-source-${version}.tar.gz" compression="gzip">
237 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
244 <target name="documentation-pdf" description="generates documentation into html form">
245 <xslt in="${temp}/docs/pdf/${document}.xml"
246 out="${temp}/docs/pdf/${document}.fo"
249 <java classname="org.apache.fop.apps.Fop" fork="yes">
252 <include name="*.jar"/>
257 <arg file="${temp}/docs/pdf/${document}.fo"/>
258 <arg file="${build}/pdfdocs/${document}.pdf"/>
262 <target name="prepare-html">
263 <mkdir dir="${build}/xslt"/>
265 <unzip dest="${build}/xslt" src="doc/lib/docbook-xsl-1.70.1.zip"/>
267 <copy todir="${build}/xslt">
268 <fileset dir="doc/style">
274 <target name="documentation-html" description="generates documentation into html form" depends="prepare-html">
275 <mkdir dir="${build}/htmldocs"/>
277 <xslt basedir="doc/installation" includes="*.xml"
278 destdir="${build}/htmldocs"
279 style="${build}/xslt/html.xsl"/>
282 <target name="full-distribution" depends="prepare-distribution,deploy,source-distribution">
283 <copy todir="${destination}/WEB-INF">
284 <fileset file="${distribution.home}/mir-source-${version}.tar.gz"/>
286 <tar tarfile="${distribution.home}/mir-${version}.tar.gz" compression="gzip">
287 <tarfileset dir="bin" includes="**/*" />