ddcb5590354e796165b8c8a2525595c3b3074fc1
[mir.git] / web / WEB-INF / build.xml
1 <project name="Mir" default="deploy" basedir=".">
2   <!--
3     - Build script for the binary distribution of the Mir project
4     -
5     - usefull tasks are:
6     -   * deploy
7     -        Creates the jars needed for a mir deployment
8     -->
9
10   <property name="version"        value="1.1.0rc0"/>
11   <property name="app.name"       value="mir"/>
12   <property name="deploy.home"    value="."/>
13
14   <!-- The temporary files made during the build process
15        will be created here: -->
16   <property name="build"     value="./build"/>
17   <property name="build.classes"  value="./${build}/classes"/>
18   <property name="build.jars"  value="./${build}/jars"/>
19   <property name="build.javadoc"   value="${build}/javadoc"/>
20
21   <!-- retrieve environment variables -->
22   <property environment="env"/>
23
24   <property name="tomcat.home"    value="${env.TOMCAT_HOME}"/>
25
26   <target name="deploy" depends="compile,generate-deployment-tree" 
27       description="Sets up a deployment directory">
28   </target>
29
30   <target name="generate-deployment-tree">
31     <property name="destination" value="${deploy.home}"/>
32
33     <copy todir="${destination}/lib">
34       <fileset dir="${build.jars}" />
35     </copy>
36   </target>
37
38   <target name="clean">
39     <delete dir="${build}"/>
40   </target>
41
42   <!-- Construct the classpath -->
43   <path id="project.classpath">
44     <fileset dir="lib">
45       <include name="*.jar"/>
46     </fileset>
47     <fileset dir="etc/extralib">
48       <include name="*.jar"/>
49     </fileset>
50
51     <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
52
53     <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
54     <fileset dir="${tomcat.home}">
55                   <include name="lib/common/*.jar" />
56           </fileset>
57     <!-- for libs shared between webapps (tomcat 3.3.x) -->
58           <fileset dir="${tomcat.home}">
59                   <include name="lib/apps/*.jar" />
60           </fileset>
61     <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
62           <fileset dir="${tomcat.home}">
63                   <include name="common/lib/*.jar" />
64           </fileset>
65     <!-- for libs shared between webapps (tomcat 4.0.x) -->
66           <fileset dir="${tomcat.home}">
67                   <include name="lib/*.jar" />
68           </fileset>
69     <!-- for libs shared between webapps (tomcat 4.1.x) -->
70           <fileset dir="${tomcat.home}">
71                   <include name="shared/lib/*.jar" />
72           </fileset>
73
74           <fileset dir="${tomcat.home}">
75                   <include name="common/endorsed/*.jar" />
76           </fileset>
77   </path>
78
79
80   <target name="prepare-compilation">
81     <mkdir  dir="${build.classes}"/>
82     <mkdir  dir="${build.jars}"/>
83     <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
84       <srcfiles dir="source" includes="**/*.java"/>
85       <srcfiles dir="lib" includes="*.jar"/>
86       <srcfiles dir="etc/extrasource" includes="**/*"/>
87       <srcfiles dir="etc/extralib" includes="*"/>
88     </uptodate>
89   </target>
90
91   <!-- compile target: compiles all files into the build/classes dir -->
92   <target name="compile" depends="prepare-compilation" unless="up.to.date"
93           description="Creates the jars needed for a mir deployment">
94           
95     <javac destdir="${build.classes}" debug="true" deprecation="off" source="1.3">
96       <src path="etc/extrasource"/>
97       <classpath refid="project.classpath"/>
98     </javac>
99
100     <delete file="${build.jars}/mir.jar"/>
101
102     <jar
103        jarfile="${build.jars}/mir.jar">
104       <fileset dir="${build.classes}" includes="**/*.class" />
105       <manifest>
106         <attribute name="Built-By" value="${user.name}"/>
107       </manifest>
108     </jar>
109   </target>
110
111
112 </project>