1 <project name="Mir" default="compile" basedir=".">
3 <!-- Property Definitions
5 Please not that only the first couple of properties have to be defined.
6 The rest, residing below the "no customization needed" line may be
7 customized if you know what you are doing. Else, leave the defaults
8 and use them to look up where ant places all the files.
10 app.name Base name of this application, used to
11 construct filenames and directories.
13 deploy.home The name of the directory into which the
14 deployment hierarchy will be created.
15 Normally, this will be the name of a
16 subdirectory under $TOMCAT_HOME/webapps.
18 deploy.classes The name of the directory that will contain
21 dist.home The name of the base directory in which
22 distribution files are created.
24 dist.src The name of the distribution JAR file
25 containing the application source code,
26 to be stored in the "dist.home" directory.
27 This filename should end with ".jar".
29 dist.war The name of the Web ARchive (WAR) file
30 containing our deployable application.
31 This filename should end with ".war".
33 javadoc.home The name of the base directory in which
34 the JavaDoc documentation for this application
37 tomcat.home The name of the base directory in which
38 Tomcat has been installed. This value is
39 normally set automatically from the value
40 of the TOMCAT_HOME environment variable.
42 java.home The location of your Java SDK.
44 java.localhome Where your local java classes and jar files
47 tomcat.home The location of the tomcat root directory.
51 <property name="app.name" value="mir"/>
52 <property name="deploy.home" value="./bin/${app.name}"/>
54 <!-- don't use unless your Jikes is >= v1.18 -->
55 <!-- <property name="build.compiler" value="jikes"/>-->
58 <!-- No customization required after this line -->
60 <property environment="env"/>
61 <property file="build.properties"/>
62 <property name="dist.home" value="${deploy.home}"/>
63 <property name="deploy.webinf" value="${deploy.home}/WEB-INF"/>
64 <property name="deploy.classes" value="${deploy.webinf}/classes"/>
65 <property name="dist.src" value="${app.name}.jar"/>
66 <property name="dist.war" value="${app.name}.war"/>
67 <property name="javadoc.home" value="${deploy.home}/javadoc"/>
68 <property name="tomcat.home" value="${env.TOMCAT_HOME}"/>
69 <property name="compile.optimize" value="off" />
70 <property name="compile.debug" value="on" />
73 <!-- Construct the classpath -->
74 <path id="project.class.path">
75 <pathelement path="${deploy.home}"/>
76 <pathelement path="${deploy.classes}"/>
77 <pathelement path="source"/>
78 <pathelement path="etc/extrasource"/>
80 <include name="*.jar"/>
83 <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
84 <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
85 <fileset dir="${tomcat.home}">
86 <include name="lib/common/*.jar" />
88 <!-- for libs shared between webapps (tomcat 3.3.x) -->
89 <fileset dir="${tomcat.home}">
90 <include name="lib/apps/*.jar" />
92 <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
93 <fileset dir="${tomcat.home}">
94 <include name="common/lib/*.jar" />
96 <!-- for libs shared between webapps (tomcat 4.0.x) -->
97 <fileset dir="${tomcat.home}">
98 <include name="lib/*.jar" />
100 <!-- for libs shared between webapps (tomcat 4.1.x) -->
101 <fileset dir="${tomcat.home}">
102 <include name="shared/lib/*.jar" />
104 <fileset dir="${tomcat.home}">
105 <include name="common/endorsed/*.jar" />
109 <target name="prepare">
110 <mkdir dir="${deploy.home}"/>
111 <mkdir dir="${deploy.webinf}"/>
112 <mkdir dir="${deploy.classes}"/>
113 <mkdir dir="${deploy.webinf}/log"/>
115 <copy todir="${deploy.home}">
119 <copy todir="${deploy.webinf}/etc">
120 <fileset dir="etc" excludes="bundles/** web.xml"/>
122 <copy todir="${deploy.classes}/bundles">
123 <fileset dir="etc/bundles"/>
125 <copy todir="${deploy.webinf}" file="etc/web.xml"/>
127 <copy todir="${deploy.webinf}/templates">
128 <fileset dir="templates"/>
131 <copy todir="${deploy.webinf}" file="source/default.properties" />
133 <copy todir="${deploy.classes}/bundles">
134 <fileset dir="bundles"/>
137 <copy todir="${deploy.home}/WEB-INF/lib">
138 <fileset dir="lib" />
142 <target name="clean">
143 <delete dir="${deploy.classes}"/>
144 <mkdir dir="${deploy.classes}"/>
147 <target name="mrproper">
148 <delete dir="${deploy.home}"/>
151 <!-- drop out if $TOMCAT_HOME is not set>-->
152 <target name="testtomcat" unless="tomcat.present">
153 <fail message="the $$TOMCAT_HOME environment variable is not set or is set to the wrong path. Please set it first. giving up!"/>
156 <target name="compile" depends="prepare">
157 <!-- check to see if $TOMCAT_HOME was set to something useful.. -->
158 <available file="${tomcat.home}/conf" property="tomcat.present"/>
159 <antcall target="testtomcat"/>
161 <srcfileset dir="source" includes="**/*.java"/>
162 <srcfileset dir="lib" includes="*.jar"/>
163 <targetfileset dir="${deploy.classes}" includes="**/*.class"/>
164 <!-- ML: now why can't this be added?
165 <srcfileset dir="etc/extrasource" includes="**/*.java"/> -->
167 <javac destdir="${deploy.classes}"
168 debug="${compile.debug}" optimize="${compile.optimize}" deprecation="on">
170 <src path="etc/extrasource"/>
171 <classpath refid="project.class.path"/>
175 <target name="javadoc" depends="prepare">
176 <javadoc packagenames="mir.*, mircoders.*"
177 sourcefiles="source/Mir.java,source/OpenMir.java"
179 destdir="${javadoc.home}">
180 <classpath refid="project.class.path"/>
184 <target name="all" depends="clean,prepare,compile,javadoc"/>