<?xml version="1.0"?>

<!--
  - Licensed to the Apache Software Foundation (ASF) under one or more
  - contributor license agreements.  See the NOTICE file distributed with
  - this work for additional information regarding copyright ownership.
  - The ASF licenses this file to You under the Apache License, Version 2.0
  - (the "License"); you may not use this file except in compliance with
  - the License.  You may obtain a copy of the License at
  -
  -     http://www.apache.org/licenses/LICENSE-2.0
  -
  - Unless required by applicable law or agreed to in writing, software
  - distributed under the License is distributed on an "AS IS" BASIS,
  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - See the License for the specific language governing permissions and
  - limitations under the License.
  -
  - $Id$
  -->

<!--
  - Build file for the Xindice Scratchpad Project.
  -
  - This script should be started with the following command line :
  -
  -     ant <target>
  -
  - Jakarta Ant can be downloaded from <http://jakarta.apache.org/ant>
  -
  - Run "ant -projecthelp" to get a list of available targets.
  -
  - Version: $Revision$ $Date$
  - Author: Vladimir R. Bossicard (vladimir@bossicard.com)
  -->

<project name="xml-xindice-scratchpad-webdav" default="release" basedir=".">

   <property name="src.dir" value="src"/>
   <property name="jar.dir" value="lib"/>
   <property name="src.build.dir" value="classes"/>
   <property name="dist.dir" value="dist"/>

   <property name="compile.debug" value="on"/>
   <property name="compile.optimize" value="off"/>
   <property name="compile.nowarn" value="off"/>
   <property name="compile.deprecation" value="on"/>
   <property name="compile.verbose" value="off"/>

   <!-- Scratchpad classpath -->
   <path id="webdav.class.path">
      <fileset dir="${jar.dir}">
         <include name="*.jar"/>
      </fileset>
      <fileset dir="../../lib">
         <include name="*.jar"/>
      </fileset>
      <fileset dir="../../../dist">
         <include name="*.jar"/>
      </fileset>
   </path>

   <target name="init">
      <tstamp/>
      <mkdir dir="${src.build.dir}"/>
      <mkdir dir="${dist.dir}"/>
   </target>

   <target name="build"
           depends="init">
      <javac srcdir="${src.dir}"
             destdir="${src.build.dir}"
             debug="${compile.debug}"
             optimize="${compile.optimize}"
             nowarn="${compile.nowarn}"
             deprecation="${compile.deprecation}"
             verbose="${compile.verbose}">
         <classpath refid="webdav.class.path"/>
      </javac>
   </target>

   <target name="release"
           depends="build">
      <echo message="---------------------------------------------------------"/>
      <echo message="Warning! Webdav is not functional yet: this is just      "/>
      <echo message="a prototype. You have been warned.                       "/>
      <echo message="---------------------------------------------------------"/>

      <war destfile="${dist.dir}/xindav.war"
           update="false"
           webxml="webapp/WEB-INF/web.xml">
         <classes dir="${src.build.dir}"/>
         <lib dir="${jar.dir}">
            <include name="avalon-excalibur-4.1.jar"/>
            <include name="servlet.jar"/>
            <include name="logkit-1.0.1.jar"/>
            <include name="avalon-framework-4.1.2.jar"/>
         </lib>
         <manifest>
            <attribute name="Built-By" value="${user.name}"/>
            <section name="org/apache/xindice">
               <attribute name="Sealed" value="false"/>
            </section>
         </manifest>
      </war>
   </target>

   <target name="clean">
      <delete dir="${src.build.dir}"/>
      <delete dir="${dist.dir}"/>
   </target>

</project>