- XML parser framework rewrite
[mir.git] / build.xml
index 58d7591..c130914 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -1,13 +1,5 @@
 <project name="Mir" default="compile" basedir=".">
 
-
-<!-- What this file is all about
-
-     You can use this version of build.xml to use directly with ant
-     i.e. without the build.sh script. Simply call ant and let it all
-     happen.
--->
-
 <!-- Property Definitions
 
      Please not that only the first couple of properties have to be defined.
@@ -56,8 +48,8 @@
 
 -->
 
-  <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"/>-->
@@ -66,6 +58,7 @@
 <!-- No customization required after this line -->
 
   <property environment="env"/>
+  <property file="build.properties"/>
   <property name="dist.home"      value="${deploy.home}"/>
   <property name="deploy.webinf"  value="${deploy.home}/WEB-INF"/>
   <property name="deploy.classes" value="${deploy.webinf}/classes"/>
@@ -73,7 +66,8 @@
   <property name="dist.war"       value="${app.name}.war"/>
   <property name="javadoc.home"   value="${deploy.home}/javadoc"/>
   <property name="tomcat.home"    value="${env.TOMCAT_HOME}"/>
-
+  <property name="compile.optimize" value="off" />
+  <property name="compile.debug" value="on" />
 
 
   <!-- Construct the classpath -->
@@ -85,6 +79,7 @@
     <fileset dir="lib">
       <include name="*.jar"/>
     </fileset>
+
     <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
   <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
        <fileset dir="${tomcat.home}">
        <fileset dir="${tomcat.home}">
                <include name="shared/lib/*.jar" />
        </fileset>
+       <fileset dir="${tomcat.home}">
+               <include name="common/endorsed/*.jar" />
+       </fileset>
   </path>
 
-
-
-<!-- The "prepare" target is used to construct the deployment home
-     directory structure (if necessary), and to copy in static files
-     as required.  In the example below, Ant is instructed to create
-     the deployment directory, copy the contents of the "web/" source
-     hierarchy, and set up the WEB-INF subdirectory appropriately.
--->
-
   <target name="prepare">
     <mkdir  dir="${deploy.home}"/>
     <mkdir  dir="${deploy.webinf}"/>
     <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>
+      <fileset dir="lib" />
     </copy>
   </target>
 
-
-
-<!-- The "clean" target removes the deployment home directory structure,
-     so that the next time the "compile" target is requested, it will need
-     to compile everything from scratch.
--->
-
-
   <target name="clean">
     <delete dir="${deploy.classes}"/>
     <mkdir dir="${deploy.classes}"/>
   </target>
 
-
-
-<!-- The "mrproper" target removes the entire deploy dir - including all
-       built pages and images.
--->
-
   <target name="mrproper">
     <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
-     structure makes this very easy because the <javac> task automatically
-     works its way down a source code hierarchy and compiles any class that
-     has not yet been compiled, or where the source file is newer than the
-     class file.
-
-     Feel free to adjust the compilation option parameters (debug,
-     optimize, and deprecation) to suit your requirements.  It is also
-     possible to base them on properties, so that you can adjust this
-     behavior at runtime.
-
-     The "compile" task depends on the "prepare" task, so the deployment
-     home directory structure will be created if needed the first time.
--->
-
   <target name="compile" depends="prepare">
     <!-- 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"/>
+      <srcfileset dir="source" includes="**/*.java"/>
+      <srcfileset dir="lib" includes="*.jar"/>         
+      <targetfileset dir="${deploy.classes}" includes="**/*.class"/>
+       <!-- ML: now why can't this be added?
+      <srcfileset dir="etc/extrasource" includes="**/*.java"/> -->   
     </dependset>
     <javac destdir="${deploy.classes}"
-           debug="on" optimize="off" deprecation="on">
+           debug="${compile.debug}" optimize="${compile.optimize}" deprecation="on">
       <src path="source"/>
       <src path="etc/extrasource"/>
       <classpath refid="project.class.path"/>
     </javac>
   </target>
 
-
-
-  <target name="perms">
-    <exec executable="./perms.sh"/>
-  </target>
-
-
-<!-- The "javadoc" target is used to create the Javadoc API documentation
-     for the Java classes in this web application.  It is assumed that
-     this documentation is included in the deployed application, so the
-     example below generates the Javadoc HTML files in a subdirectory under
-     the deployment home directory.  Feel free to customize the options for
-     the JavaDoc task, after consulting the Ant documentation.
--->
-
   <target name="javadoc" depends="prepare">
     <javadoc packagenames="mir.*, mircoders.*"
-            sourcefiles="source/${app.name}.java,source/Open${app.name}.java"
+            sourcefiles="source/Mir.java,source/OpenMir.java"
             sourcepath="source"
              destdir="${javadoc.home}">
          <classpath refid="project.class.path"/>
        </javadoc>
   </target>
 
-
-<!-- The "all" target rebuilds everything by executing the "clean"
-     target first, which forces the "compile" target to compile all
-     source code instead of just the files that have been changed.
--->
-
   <target name="all" depends="clean,prepare,compile,javadoc"/>
 
-
-<!-- The "dist" target builds the distribution Web ARchive (WAR) file
-     for this application, suitable for distribution to sites that wish
-     to install your application.  It also creates a JAR file containing
-     the source code for this application, if you wish to distribute
-     that separately.
--->
-  <target name="dist" depends="prepare,compile">
-    <jar jarfile="${dist.home}/mirbase.jar"
-        includes="mir/**"
-        basedir="${deploy.classes}"/>
-    <jar jarfile="${dist.home}/${dist.src}"
-         basedir="./source"/>
-    <jar jarfile="${dist.home}/${dist.war}"
-         basedir="${deploy.home}"
-         excludes="${dist.war}"/>
-  </target>
-
 </project>