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" value="./build"/>
35 <property name="build.classes" value="./${build}/classes"/>
36 <property name="build.jars" value="./${build}/jars"/>
37 <property name="build.javadoc" value="${build}/javadoc"/>
39 <!-- retrieve environment variables -->
40 <property environment="env"/>
42 <property name="tomcat.home" value="${env.TOMCAT_HOME}"/>
45 <property name="compile.optimize" value="off" />
46 <property name="compile.debug" value="on" />
49 <target name="deploy" depends="compile,generate-deployment-tree"
50 description="Sets up a deployment directory">
53 <target name="debug" depends="compile-debug,generate-deployment-tree"
54 description="Sets up a deployment directory with debug enabled">
57 <target name="generate-deployment-tree">
58 <property name="destination" value="${deploy.home}"/>
59 <mkdir dir="${destination}"/>
60 <mkdir dir="${destination}/WEB-INF"/>
61 <delete dir="${destination}/WEB-INF/lib"/>
62 <mkdir dir="${destination}/WEB-INF/lib"/>
63 <mkdir dir="${destination}/WEB-INF/log"/>
65 <copy todir="${destination}">
69 <copy todir="${destination}/WEB-INF/etc">
70 <fileset dir="etc" excludes="extrasource,extralib"/>
73 <copy todir="${destination}/WEB-INF">
77 <copy todir="${destination}/WEB-INF/templates">
78 <fileset dir="templates"/>
81 <copy todir="${destination}/WEB-INF/bundles">
82 <fileset dir="bundles"/>
85 <copy todir="${destination}/WEB-INF" file="source/default.properties" />
87 <copy todir="${destination}/WEB-INF/lib">
89 <fileset dir="etc/extralib" />
90 <fileset dir="${build.jars}" />
95 <delete dir="${build}"/>
98 <!-- Construct the classpath -->
99 <path id="project.classpath">
101 <include name="*.jar"/>
103 <fileset dir="etc/extralib">
104 <include name="*.jar"/>
107 <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
109 <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
110 <fileset dir="${tomcat.home}">
111 <include name="lib/common/*.jar" />
113 <!-- for libs shared between webapps (tomcat 3.3.x) -->
114 <fileset dir="${tomcat.home}">
115 <include name="lib/apps/*.jar" />
117 <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
118 <fileset dir="${tomcat.home}">
119 <include name="common/lib/*.jar" />
121 <!-- for libs shared between webapps (tomcat 4.0.x) -->
122 <fileset dir="${tomcat.home}">
123 <include name="lib/*.jar" />
125 <!-- for libs shared between webapps (tomcat 4.1.x) -->
126 <fileset dir="${tomcat.home}">
127 <include name="shared/lib/*.jar" />
130 <fileset dir="${tomcat.home}">
131 <include name="common/endorsed/*.jar" />
136 <target name="prepare-compilation">
137 <mkdir dir="${build.classes}"/>
138 <mkdir dir="${build.jars}"/>
139 <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
140 <srcfiles dir="source" includes="**/*.java"/>
141 <srcfiles dir="lib" includes="*.jar"/>
142 <srcfiles dir="etc/extrasource" includes="**/*"/>
143 <srcfiles dir="etc/extralib" includes="*"/>
147 <!-- compile target: compiles all files into the build/classes dir -->
148 <target name="compile" depends="prepare-compilation" unless="up.to.date"
149 description="Creates the jars needed for a mir deployment">
151 <javac destdir="${build.classes}" debug="true">
153 <src path="etc/extrasource"/>
154 <classpath refid="project.classpath"/>
158 jarfile="${build.jars}/mir.jar">
159 <fileset dir="${build.classes}" includes="**/*.class" />
161 <attribute name="Built-By" value="${user.name}"/>
166 <!-- compile a debuggable version -->
167 <target name="compile-debug" depends="prepare-compilation">
168 <javac destdir="${build.classes}"
169 debug="on" optimize="off" deprecation="on">
171 <src path="etc/extrasource"/>
172 <classpath refid="project.classpath"/>
177 <!-- build the project's javadoc -->
178 <target name="javadoc" depends="prepare-javadoc">
180 destdir="${build.javadoc}"
184 packagenames="mir.*,mircoders.*"
186 sourcefiles="source/Mir.java,source/OpenMir.java"
189 <classpath refid="project.classpath"/>
190 <link href="http://java.sun.com/j2se/1.3/docs/api"/>
194 <target name="prepare-javadoc">
195 <mkdir dir="${build.javadoc}"/>
198 <target name="prepare-binary-distribution">
199 <mkdir dir="${distribution.home}"/>
200 <delete dir="${build}/binarydist"/>
201 <mkdir dir="${build}/binarydist"/>
204 <target name="binary-distribution" depends="prepare-binary-distribution">
205 <antcall target="generate-deployment-tree">
206 <param name="destination" value="${build}/binarydist"/>
209 <zip zipfile="${distribution.home}/binary.zip" >
210 <fileset dir="${build}/binarydist" includes="**/*" />
214 <target name="prepare-source-distribution">
215 <mkdir dir="${distribution.home}"/>
218 <target name="source-distribution" depends="prepare-source-distribution">
219 <zip zipfile="${distribution.home}/source.zip" >
221 includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
228 <target name="documentation-pdf" description="generates documentation into html form">
229 <xslt in="${temp}/docs/pdf/${document}.xml"
230 out="${temp}/docs/pdf/${document}.fo"
233 <java classname="org.apache.fop.apps.Fop" fork="yes">
236 <include name="*.jar"/>
241 <arg file="${temp}/docs/pdf/${document}.fo"/>
242 <arg file="${build}/pdfdocs/${document}.pdf"/>
246 <target name="prepare-html">
247 <mkdir dir="${build}/xslt"/>
249 <unzip dest="${build}/xslt" src="doc/lib/docbook-xsl-1.66.1.zip"/>
251 <copy todir="${build}/xslt">
252 <fileset dir="doc/style">
258 <target name="documentation-html" description="generates documentation into html form" depends="prepare-html">
259 <mkdir dir="${build}/htmldocs"/>
261 <xslt basedir="doc/installation" includes="*.xml"
262 destdir="${build}/htmldocs"
263 style="${build}/xslt/html.xsl"/>