ant build file for the binary distribuition
authorpietrus <pietrus>
Wed, 23 Aug 2006 00:21:45 +0000 (00:21 +0000)
committerpietrus <pietrus>
Wed, 23 Aug 2006 00:21:45 +0000 (00:21 +0000)
web/WEB-INF/build.xml [new file with mode: 0644]

diff --git a/web/WEB-INF/build.xml b/web/WEB-INF/build.xml
new file mode 100644 (file)
index 0000000..ddcb559
--- /dev/null
@@ -0,0 +1,112 @@
+<project name="Mir" default="deploy" basedir=".">
+  <!--
+    - Build script for the binary distribution of the Mir project
+    -
+    - usefull tasks are:
+    -   * deploy
+    -        Creates the jars needed for a mir deployment
+    -->
+
+  <property name="version"        value="1.1.0rc0"/>
+  <property name="app.name"       value="mir"/>
+  <property name="deploy.home"    value="."/>
+
+  <!-- The temporary files made during the build process
+       will be created here: -->
+  <property name="build"     value="./build"/>
+  <property name="build.classes"  value="./${build}/classes"/>
+  <property name="build.jars"  value="./${build}/jars"/>
+  <property name="build.javadoc"   value="${build}/javadoc"/>
+
+  <!-- retrieve environment variables -->
+  <property environment="env"/>
+
+  <property name="tomcat.home"    value="${env.TOMCAT_HOME}"/>
+
+  <target name="deploy" depends="compile,generate-deployment-tree" 
+      description="Sets up a deployment directory">
+  </target>
+
+  <target name="generate-deployment-tree">
+    <property name="destination" value="${deploy.home}"/>
+
+    <copy todir="${destination}/lib">
+      <fileset dir="${build.jars}" />
+    </copy>
+  </target>
+
+  <target name="clean">
+    <delete dir="${build}"/>
+  </target>
+
+  <!-- Construct the classpath -->
+  <path id="project.classpath">
+    <fileset dir="lib">
+      <include name="*.jar"/>
+    </fileset>
+    <fileset dir="etc/extralib">
+      <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}">
+                 <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>
+
+         <fileset dir="${tomcat.home}">
+                 <include name="common/endorsed/*.jar" />
+         </fileset>
+  </path>
+
+
+  <target name="prepare-compilation">
+    <mkdir  dir="${build.classes}"/>
+    <mkdir  dir="${build.jars}"/>
+    <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
+      <srcfiles dir="source" includes="**/*.java"/>
+      <srcfiles dir="lib" includes="*.jar"/>
+      <srcfiles dir="etc/extrasource" includes="**/*"/>
+      <srcfiles dir="etc/extralib" includes="*"/>
+    </uptodate>
+  </target>
+
+  <!-- compile target: compiles all files into the build/classes dir -->
+  <target name="compile" depends="prepare-compilation" unless="up.to.date"
+          description="Creates the jars needed for a mir deployment">
+          
+    <javac destdir="${build.classes}" debug="true" deprecation="off" source="1.3">
+      <src path="etc/extrasource"/>
+      <classpath refid="project.classpath"/>
+    </javac>
+
+    <delete file="${build.jars}/mir.jar"/>
+
+    <jar
+       jarfile="${build.jars}/mir.jar">
+      <fileset dir="${build.classes}" includes="**/*.class" />
+      <manifest>
+        <attribute name="Built-By" value="${user.name}"/>
+      </manifest>
+    </jar>
+  </target>
+
+
+</project>