<?xml version="1.0" encoding="UTF-8"?>

<!--
  - 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 Xindice Admin Scratchpad

Notes:
   This is a build file for use with the Jakarta Ant java build tool.

How to build:

   To build, run

     cd $XINDICE_HOME/java/scratchpad/admin

     Build:

     ../../../bin/ant build

How to run:
   Make sure Xindice is running (currently the admin code is using a hard-coded url of localhost:8888)
   Use the shell script in $XINDICE_HOME/java/scratchpad/admin (xindiceadmin.sh)

-->

<project name="xindice-admin-scratchpad" default="build" basedir=".">

  <!-- =================================================================== -->
  <!-- Initializes the build process                                       -->
  <!-- =================================================================== -->
  <!-- default directory structure definitions -->
  <property name="xindice.home" value="../../../"/>

  <property name="root.dir" value="."/>
  <property name="jar.dir" value="${root.dir}/../../lib"/>
  <property name="src.dir" value="${root.dir}/src"/>
  <property name="build.dir" value="${root.dir}/classes"/>

  <!-- classpath to use within project -->
  <path id="project.class.path">
    <!-- compiled classes directory -->
    <pathelement location="${build.dir}"/>

    <!-- all jars in jar directory -->
    <fileset dir="${jar.dir}">
      <include name="*.jar"/>
    </fileset>

    <!-- system property, environment classpath -->
    <pathelement path="${java.class.path}"/>
  </path>

  <target name="init">
    <tstamp/>
    <property name="name" value="xindice-admin"/>
    <property name="version" value="0.1"/>
  </target>

  <!-- =================================================================== -->
  <!-- Prepares the build directory                                        -->
  <!-- =================================================================== -->
  <target name="prepare" depends="init">
    <mkdir dir="${build.dir}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the source                                                 -->
  <!-- =================================================================== -->
  <target name="compile" depends="prepare">
    <echo message="Compiling Xindice Admin - Scratchpad"/>
    <javac srcdir="${src.dir}"
           destdir="${build.dir}"
           classpathref="project.class.path"
           debug="on"
           />
  </target>

  <target name="build" depends="init, compile">
   <jar jarfile="${xindice.home}/java/lib/xindice-admin-0.1.jar"
        basedir="${build.dir}">
    </jar>
   </target>

  <!-- =================================================================== -->
  <!-- Cleans everything                                                   -->
  <!-- =================================================================== -->
  <target name="clean">
    <delete dir="${build.dir}"/>
  </target>


</project>
