the application is now copied and compiles into the \rdirectory mir/bin.\ri changed...
[mir.git] / build.xml
index c68923d..b4429b4 100755 (executable)
--- a/build.xml
+++ b/build.xml
 
 -->
 
-  <property name="app.name"       value="Mir"/>
-  <property name="deploy.home"    value="../${app.name}"/>
+  <property name="app.name"       value="mir"/>
+  <property name="deploy.home"    value="./bin/${app.name}"/>
+
+  <!-- don't use unless your Jikes is >= v1.18 -->
+  <!-- <property name="build.compiler"   value="jikes"/>-->
 
 
 <!-- No customization required after this line -->
@@ -71,9 +74,6 @@
   <property name="javadoc.home"   value="${deploy.home}/javadoc"/>
   <property name="tomcat.home"    value="${env.TOMCAT_HOME}"/>
 
-  <!-- If you want to use the very good jikes compiler, uncomment this 
-  <property name="build.compiler"   value="jikes"/> -->
-
 
 
   <!-- Construct the classpath -->
     <pathelement path="${deploy.home}"/>
     <pathelement path="${deploy.classes}"/>
     <pathelement path="source"/>
+    <pathelement path="etc/extrasource"/>
     <fileset dir="lib">
       <include name="*.jar"/>
     </fileset>
     <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
-       <fileset dir="${tomcat.home}/lib/common">
-               <include name="*.jar" />
+  <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
+       <fileset dir="${tomcat.home}">
+               <include name="lib/common/*.jar" />
+       </fileset>
+  <!-- for libs shared between webapps (tomcat 3.3.x) -->
+       <fileset dir="${tomcat.home}">
+               <include name="lib/apps/*.jar" />
+       </fileset>
+  <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
+       <fileset dir="${tomcat.home}">
+               <include name="common/lib/*.jar" />
+       </fileset>
+  <!-- for libs shared between webapps (tomcat 4.0.x) -->
+       <fileset dir="${tomcat.home}">
+               <include name="lib/*.jar" />
+       </fileset>
+  <!-- for libs shared between webapps (tomcat 4.1.x) -->
+       <fileset dir="${tomcat.home}">
+               <include name="shared/lib/*.jar" />
        </fileset>
   </path>
 
 
   <target name="prepare">
     <mkdir  dir="${deploy.home}"/>
+    <mkdir  dir="${deploy.webinf}"/>
+    <mkdir  dir="${deploy.classes}"/>
+    <mkdir  dir="${deploy.webinf}/log"/>
+
     <copy todir="${deploy.home}">
       <fileset dir="web"/>
     </copy>
-    <mkdir  dir="${deploy.home}/templates"/>
-    <copy todir="${deploy.home}/templates">
-      <fileset dir="templates"/>
+
+    <copy todir="${deploy.webinf}/etc">
+      <fileset dir="etc" excludes="bundles/** web.xml"/>
     </copy>
-    <mkdir  dir="${deploy.home}/src"/>
-    <copy todir="${deploy.home}/src">
-      <fileset dir="source"/>
+    <copy todir="${deploy.classes}/bundles">
+        <fileset dir="etc/bundles"/>
     </copy>
+    <copy todir="${deploy.webinf}" file="etc/web.xml"/>
 
-    <mkdir  dir="${deploy.home}/WEB-INF"/>
-    <copy  file="etc/web.xml"          tofile="${deploy.home}/WEB-INF/web.xml"/>
-    <mkdir  dir="${deploy.classes}"/>
-    <mkdir  dir="${deploy.home}/WEB-INF/lib"/>
+    <copy todir="${deploy.webinf}/templates">
+      <fileset dir="templates"/>
+    </copy>
+    
+    <copy todir="${deploy.webinf}" file="source/default.properties" />
+    
+    <copy todir="${deploy.classes}/bundles">
+      <fileset dir="bundles"/>
+    </copy>
+    
     <copy todir="${deploy.home}/WEB-INF/lib">
       <fileset dir="lib">
         <exclude name="ant.jar"/>
         <exclude name="xerces.jar"/>
       </fileset>
     </copy>
-    <mkdir  dir="${javadoc.home}"/>
-    <mkdir  dir="${deploy.home}/log"/>
-
   </target>
 
 
 
   <target name="clean">
     <delete dir="${deploy.classes}"/>
-       <mkdir dir="${deploy.classes}"/>
+    <mkdir dir="${deploy.classes}"/>
   </target>
 
 
     <delete dir="${deploy.home}"/>
   </target>
 
-
+  <!-- drop out if $TOMCAT_HOME is not set>-->
+  <target name="testtomcat" unless="tomcat.present">
+    <fail message="the $$TOMCAT_HOME environment variable is not set or is set to the wrong path. Please set it first. giving up!"/>
+  </target>
 
 <!-- The "compile" target is used to compile (or recompile) the Java classes
      that make up this web application.  The recommended source code directory
 -->
 
   <target name="compile" depends="prepare">
-       <antcall target="clean"/>
-    <javac srcdir="source" destdir="${deploy.classes}"
+    <!-- check to see if $TOMCAT_HOME was set to something useful.. -->
+    <available file="${tomcat.home}/conf" property="tomcat.present"/>
+    <antcall target="testtomcat"/>
+
+    <!--<antcall target="clean"/>-->
+    <dependset>
+      <srcfileset
+        dir="source"
+        includes="**/*.java"/>
+<!-- ML: now why can't this be added?
+      <srcfileset
+        dir="etc/extrasource"
+        includes="**/*.java"/> -->
+      <srcfileset
+        dir="lib"
+        includes="*.jar"/>
+      <targetfileset
+        dir="${deploy.classes}"
+        includes="**/*.class"/>
+    </dependset>
+    <javac destdir="${deploy.classes}"
            debug="on" optimize="off" deprecation="on">
+      <src path="source"/>
+      <src path="etc/extrasource"/>
       <classpath refid="project.class.path"/>
-       </javac>
-    <copy   todir="${deploy.classes}">
-      <fileset dir="source" includes="**/*.properties"/>
-    </copy>
-    <copy   todir="${deploy.home}">
-      <fileset dir="source" includes="**/content-types.properties"/>
-      <fileset dir="source" includes="**/server.xml"/>
-    </copy>
-    <copy   todir="${deploy.classes}/bundles">
-      <fileset dir="bundles" includes="**/*.properties"/>
-    </copy>
+    </javac>
   </target>
 
 
 
   <target name="perms">
-       <exec executable="./perms.sh"/>
+    <exec executable="./perms.sh"/>
   </target>