Fixed a type in a comment.
[java-idp.git] / build.xml
index 49784fb..1962771 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -1,28 +1,56 @@
-<project name="AA" default="dist" basedir=".">
-
-  <!-- set global properties for this build -->
-  <property name="src" value="."/>
-  <property name="build" value="build"/>
-  <property name="dist"  value="/var/tomcat3/webapps/"/>
-  <target name="init">
-    <!-- Create the time stamp -->
-    <tstamp/>
-    <!-- Create the build directory structure used by compile -->
-    <mkdir dir="${build}" />
-  </target>
-
-  <target name="compile" depends="init">
-    <!-- Compile the java code from ${src} into ${build} -->
-    <javac srcdir="${src}" destdir="${build}" classpath=".:/usr/java/jdk1.3.1_02/lib/jre:/usr/local/shib/lib/shibboleth.jar:/usr/local/shib/lib/xmlParserAPIs.jar:/usr/local/shib/lib/xercesImpl.jar:/var/tomcat3/lib/common/servlet.jar:/var/tomcat3/lib/common/mm.mysql-2.0.8-bin.jar"/>
-  </target>
-  <target name="dist" depends="compile">
-    <war warfile="shibb.war" webxml="web.xml">
-      <classes dir="build"/>
-    </war>
-    <copy file="shibb.war" tofile="${dist}/shibb.war">
-    </copy>
-  </target>
+<project default="dist" basedir=".">
 
-</project>
+       <property name="distname" value="shibboleth"/>
+
+       <!-- set global properties for this build -->
+       <property name="root" value="."/>
+       <property name="src" value="${root}/source"/>
+       <property name="approot" value="${root}/webApplication"/>
+       <property name="build" value="${approot}/WEB-INF/classes"/>
+       <property name="libdir" value="${approot}/WEB-INF/lib"/>
+       <property name="buildlibs" value="${root}/buildlibs"/>
+       <property name="dist" value="${root}/dist"/>
+
+       <path id="build.path">
+               <pathelement path="${classpath}"/>
+               <pathelement location="${build}"/>
+               <fileset dir="${libdir}">
+                       <include name="**/*.jar"/>
+               </fileset>
+               <fileset dir="${buildlibs}">
+                       <include name="**/*.jar"/>
+               </fileset>
+
+       </path>
+
+       <!-- Prepare directory structure for project build-->
+       <target name="init">
+               <mkdir dir="${build}"/>
+               <mkdir dir="${dist}"/>
+       </target>
+
+       <!-- Compile classes and move them to ${build} -->
+       <target name="compile" depends="init">
+               <javac srcdir="${src}" destdir="${build}" includes="**/*.java" debug="on">
+                       <classpath refid="build.path"/>
+               </javac>
+       </target>
 
+       <target name="package">
+               <war warfile="${dist}/${distname}.war" webxml="${approot}/WEB-INF/web.xml" basedir="${approot}" update="no"/>
+       </target>
+
+       <target name="dist" depends="compile, package, clean-build"/>
+
+       <!-- Delete the ${build} and ${dist} directory trees -->
+       <target name="clean" depends="clean-build, clean-dist"/>
+
+       <target name="clean-build">
+               <delete dir="${build}"/>
+       </target>
+
+       <target name="clean-dist">
+               <delete dir="${dist}"/>
+       </target>
+
+</project>