<?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.
 
   $Header:$
 -->

<project name="Beehive petstoreWeb sample" default="build" basedir="../..">

    <property file="${basedir}/WEB-INF/src/build.properties"/>
    <import file="${beehive.dir}/beehive-imports.xml"/>
  
    <property name="webapp.dir" location="${basedir}"/>
    <property name="archive.dir" location="${basedir}/.."/>
  
    <!-- ========================================= -->
    <!-- build - build the webapp                  -->
    <!-- ========================================= -->

    <target name="build" description="Build the webapp">
        <deploy-netui webappDir="${webapp.dir}"/>
        <build-webapp webappDir="${webapp.dir}"/>
    </target>
  
    <!-- ========================================= -->
    <!-- clean - clean the webapp                  -->
    <!-- ========================================= -->

    <target name="clean" description="Clean the webapp">
        <clean-webapp webappDir="${webapp.dir}"/>
    </target>

    <target name="war" description="Create .war file for webapp">
        <war destfile="${archive.dir}/${context.path}.war" webxml="${webapp.dir}/WEB-INF/web.xml">
            <fileset dir="${webapp.dir}">
                <exclude name="WEB-INF/web.xml"/>
            </fileset>
        </war>
    </target>

    <!-- =========================================== -->
    <!-- deploy targets - move the app to the server -->
    <!-- =========================================== -->
  
    <target name="deploy" description="Deploy the webapp to a running server">
        <deploy-webapp webappDir="${webapp.dir}" contextPath="${context.path}"/>
    </target>

    <target name="undeploy" description="Undeploy the webapp from a running server">
        <undeploy-webapp contextPath="${context.path}"/>
    </target>

    <target name="redeploy" description="Redeploy the webapp on a running server">
        <redeploy-webapp contextPath="${context.path}"/>
    </target>
  
</project>