-<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
- app.name Base name of this application, used to
- construct filenames and directories.
-
- deploy.home The name of the directory into which the
- deployment hierarchy will be created.
- Normally, this will be the name of a
- subdirectory under $TOMCAT_HOME/webapps.
-
- dist.home The name of the base directory in which
- distribution files are created.
-
- dist.src The name of the distribution JAR file
- containing the application source code,
- to be stored in the "dist.home" directory.
- This filename should end with ".jar".
-
- dist.war The name of the Web ARchive (WAR) file
- containing our deployable application.
- This filename should end with ".war".
-
- javadoc.home The name of the base directory in which
- the JavaDoc documentation for this application
- is generated.
-
- tomcat.home The name of the base directory in which
- Tomcat has been installed. This value is
- normally set automatically from the value
- of the TOMCAT_HOME environment variable.
-
- java.home The location of your Java SDK.
-
- java.localhome Where your local java classes and jar files
- are located.
-
- tomcat.home The location of the tomcat root directory.
-
--->
-
- <property name="app.name" value="Mir"/>
- <property name="deploy.home" value="../${app.name}"/>
- <property name="dist.home" value="${deploy.home}"/>
- <property name="dist.src" value="${app.name}.jar"/>
- <property name="dist.war" value="${app.name}.war"/>
- <property name="javadoc.home" value="${deploy.home}/javadoc"/>
-
- <property name="java.home" value="/usr/lib/j2sdk1.3/"/>
- <property name="java.localhome" value="/usr/share/java/"/>
- <property name="tomcat.home" value="/usr/share/tomcat/"/>
-
-
- <!-- Construct the classpath -->
- <path id="project.class.path">
- <pathelement path="${deploy.home}"/>
- <pathelement path="${deploy.home}/WEB-INF/classes"/>
- <pathelement path="source"/>
- <fileset dir="lib">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="${java.home}/lib">
- <include name="tools.jar"/>
- <include name="rt.jar"/>
- </fileset>
- <fileset dir="${java.localhome}">
- <include name="*.jar"/>
- </fileset>
- <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
- </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}"/>
- <copy todir="${deploy.home}">
- <fileset dir="web"/>
- </copy>
- <mkdir dir="${deploy.home}/templates"/>
- <copy todir="${deploy.home}/templates">
- <fileset dir="templates"/>
- </copy>
- <mkdir dir="${deploy.home}/src"/>
- <copy todir="${deploy.home}/src">
- <fileset dir="source"/>
- </copy>
-
- <mkdir dir="${deploy.home}/WEB-INF"/>
- <copy file="etc/web.xml" tofile="${deploy.home}/WEB-INF/web.xml"/>
- <mkdir dir="${deploy.home}/WEB-INF/classes"/>
- <mkdir dir="${deploy.home}/WEB-INF/lib"/>
- <copy todir="${deploy.home}/WEB-INF/lib">
- <fileset dir="lib">
- <exclude name="ant.jar"/>
- <exclude name="xerces.jar"/>
- </fileset>
- </copy>
- <copy todir="${deploy.home}/WEB-INF/classes">
- <fileset dir="bundles"/>
- </copy>
- <mkdir dir="${javadoc.home}"/>
- <mkdir dir="${deploy.home}/log"/>
-
- </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.home}"/>
- </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">
- <javac srcdir="source" destdir="${deploy.home}/WEB-INF/classes"
- debug="on" optimize="off" deprecation="on">
- <classpath refid="project.class.path"/>
- </javac>
- <copy todir="${deploy.home}/WEB-INF/classes">
- <fileset dir="source" includes="**/*.properties"/>
- </copy>
- <copy todir="${deploy.home}">
- <fileset dir="source" includes="**/content-types.properties"/>
- </copy>
- <echo>
- Now you should call perms.sh(-dist) in order to set
- the permissions of your installed files to a meaningful
- value.
- Have fun with Mir!
- </echo>
- </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"
- 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="mirbase.jar"
- includes="mir/**"
- basedir="../Mir/WEB-INF/classes"/>
- <jar jarfile="${dist.src}"
- basedir="./source"/>
- <jar jarfile="${dist.war}"
- basedir="${deploy.home}"/>
- </target>
-
-</project>