<?xml version="1.0"?>
<project name="playn" default="compile" xmlns:artifact="urn:maven-artifact-ant">
  <import file="etc/build-maven.xml"/>

  <!-- TODO: find suitable way to factor out module list; ant doesn't have any
       stock iteration capabilities and depending on ant-contrib is annoying -->
  <target name="clean" description="Cleans out all submodule build results.">
    <ant dir="core" target="clean"/>
    <ant dir="gwtbox2d" target="clean"/>
    <ant dir="webgl" target="clean"/>
    <ant dir="java" target="clean"/>
    <ant dir="html" target="clean"/>
    <ant dir="flash" target="clean"/>
    <ant dir="android" target="clean"/>
    <ant dir="server" target="clean"/>
    <ant dir="test/benchmark" target="clean"/>
    <ant dir="test/manualtests" target="clean"/>
  </target>

  <target name="compile" description="Compiles all submodules.">
    <ant dir="core" target="compile"/>
    <ant dir="gwtbox2d" target="compile"/>
    <ant dir="webgl" target="compile"/>
    <ant dir="java" target="compile"/>
    <ant dir="html" target="compile"/>
    <ant dir="flash" target="compile"/>
    <ant dir="android" target="compile"/>
    <ant dir="server" target="compile"/>
    <ant dir="test/benchmark" target="compile"/>
    <ant dir="test/manualtests" target="compile"/>
  </target>

  <target name="install" depends="-init-maven-ant"
          description="Compiles and deploys all submodules to local Maven repository.">
    <ant dir="core" target="install"/>
    <ant dir="gwtbox2d" target="install"/>
    <ant dir="webgl" target="install"/>
    <ant dir="java" target="install"/>
    <ant dir="html" target="install"/>
    <ant dir="flash" target="install"/>
    <ant dir="android" target="install"/>
    <ant dir="server" target="install"/>
    <!-- install the playn-project artifact which is just a pom -->
    <artifact:install file="pom.xml">
      <pom file="pom.xml"/>
    </artifact:install>
  </target>
</project>