<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 1995-2012 held by the author(s).  All rights reserved.
                          
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    * Neither the names of the Naval Postgraduate School (NPS)
      Modeling Virtual Environments and Simulation (MOVES) Institute
      (https://www.nps.edu and https://MovesInstitute.nps.edu)
      nor the names of its contributors may be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-->

<!--
    Document   : build.xml
    Created on : 8 November 2012
    Author     : Don Brutzman, Don McGregor, Chad Hutchins
    Description: Ant build.xml file for piracy project
    Version    : $Id: build.xml 11775 2012-10-30 19:32:51Z brutzman $
-->

<project name="Savage Scenarios Piracy" default="all" basedir=".">
    <description>Build Savage / Scenarios / Piracy examples!</description>

    <!-- ======================================================================================== -->

    <property environment="env"/>

    <property name="lib.dir" value="../../lib"/>
    
    <!-- project directories -->
    <property name="src"         location="java/edu/nps/moves/piracy"/>
    <property name="javadoc"     location="javadoc"/>
    <property name="classes"     location="classes"/>
    <property name="verbose"     location="true"/>
    
    <!-- classpaths -->
    <path id="compile.classpath">
        <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>
    </path>
    
    <target name="build" depends="compile,javadoc" description="prepare the whole enchilada"/>
    
    <target name="compile" depends="" description="compile all source">
        <mkdir dir="classes" description="if needed"/>
        <javac deprecation="true"
               srcdir="${src}"
               destdir="${classes}"
               verbose="${verbose}"
               includeAntRuntime="no">
            <classpath refid="compile.classpath"/>
        </javac>
    </target>
    
    <target name="javadoc" depends="compile" description="compile all source">
        <mkdir dir="javadoc" description="if needed"/>
        <javadoc
               destdir="${javadoc}"
               verbose="${verbose}">
            <classpath refid="compile.classpath"/>
            <fileset dir="${src}" defaultexcludes="yes"/>
        </javadoc>
    </target>
    
    <target name="run.PiracyScenario" depends="">
        <parallel>
            <antcall target="run.Helicopter" />
            <antcall target="run.PirateSkiff" />
        </parallel>
    </target>
    
    <target name="run.Helicopter" depends="compile" description="initial demo">
        <java classname="edu.nps.moves.piracy.HelicopterPduSender" fork="true" classpath="">
            <classpath path="${classes}"/>
            <classpath refid="compile.classpath"/>
        </java>
    </target>
    
    <target name="run.PirateSkiff" depends="compile" description="initial demo">
        <java classname="edu.nps.moves.piracy.SkiffPduSender" fork="true" classpath="">
            <classpath path="${classes}"/>
            <classpath refid="compile.classpath"/>
        </java>
    </target>
    
</project>