*** empty log message ***
[mir.git] / build.xml
1 <project name="Mir" default="compile" basedir=".">
2
3 <!-- Property Definitions
4
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.
9
10      app.name          Base name of this application, used to
11                        construct filenames and directories.
12
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.
17
18      deploy.classes    The name of the directory that will contain
19                        the class files.
20
21      dist.home         The name of the base directory in which
22                        distribution files are created.
23
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".
28
29      dist.war          The name of the Web ARchive (WAR) file
30                        containing our deployable application.
31                        This filename should end with ".war".
32
33      javadoc.home      The name of the base directory in which
34                        the JavaDoc documentation for this application
35                        is generated.
36
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.
41
42         java.home          The location of your Java SDK.
43
44         java.localhome     Where your local java classes and jar files
45                        are located.
46
47         tomcat.home        The location of the tomcat root directory.
48
49 -->
50
51   <property name="app.name"       value="mir"/>
52   <property name="deploy.home"    value="./bin/${app.name}"/>
53
54   <!-- don't use unless your Jikes is >= v1.18 -->
55   <!-- <property name="build.compiler"   value="jikes"/>-->
56
57
58 <!-- No customization required after this line -->
59
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" />
71
72
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"/>
79     <fileset dir="lib">
80       <include name="*.jar"/>
81     </fileset>
82   </path>
83
84   <target name="prepare">
85     <mkdir  dir="${deploy.home}"/>
86     <mkdir  dir="${deploy.webinf}"/>
87     <mkdir  dir="${deploy.classes}"/>
88     <mkdir  dir="${deploy.webinf}/log"/>
89
90     <copy todir="${deploy.home}">
91       <fileset dir="web"/>
92     </copy>
93
94     <copy todir="${deploy.webinf}/etc">
95       <fileset dir="etc" excludes="bundles/** web.xml"/>
96     </copy>
97     <copy todir="${deploy.classes}/bundles">
98         <fileset dir="etc/bundles"/>
99     </copy>
100     <copy todir="${deploy.webinf}" file="etc/web.xml"/>
101
102     <copy todir="${deploy.webinf}/templates">
103       <fileset dir="templates"/>
104     </copy>
105     
106     <copy todir="${deploy.webinf}" file="source/default.properties" />
107     
108     <copy todir="${deploy.classes}/bundles">
109       <fileset dir="bundles"/>
110     </copy>
111     
112     <copy todir="${deploy.home}/WEB-INF/lib">
113       <fileset dir="lib">
114         <exclude name="ant.jar"/>
115         <exclude name="xerces.jar"/>
116       </fileset>
117     </copy>
118   </target>
119
120   <target name="clean">
121     <delete dir="${deploy.classes}"/>
122     <mkdir dir="${deploy.classes}"/>
123   </target>
124
125   <target name="mrproper">
126     <delete dir="${deploy.home}"/>
127   </target>
128
129   <target name="compile" depends="prepare">
130     <dependset>
131       <srcfileset
132         dir="source"
133         includes="**/*.java"/>
134         <!-- ML: now why can't this be added?
135       <srcfileset
136         dir="etc/extrasource"
137         includes="**/*.java"/> -->
138       <srcfileset
139         dir="lib"
140         includes="*.jar"/>
141       <targetfileset
142         dir="${deploy.classes}"
143         includes="**/*.class"/>
144     </dependset>
145     <javac destdir="${deploy.classes}"
146            debug="${compile.debug}" optimize="${compile.optimize}" deprecation="on">
147       <src path="source"/>
148       <src path="etc/extrasource"/>
149       <classpath refid="project.class.path"/>
150     </javac>
151   </target>
152
153   <target name="perms">
154     <exec executable="./perms.sh"/>
155   </target>
156
157   <target name="javadoc" depends="prepare">
158     <javadoc packagenames="mir.*, mircoders.*"
159              sourcefiles="source/Mir.java,source/OpenMir.java"
160              sourcepath="source"
161              destdir="${javadoc.home}">
162           <classpath refid="project.class.path"/>
163         </javadoc>
164   </target>
165
166   <target name="all" depends="clean,prepare,compile,javadoc"/>
167
168 </project>