<project name="slippymap" default="dist" basedir=".">


  <!-- compilation properties -->
  <property name="josm.build.dir"	value="../../core"/>
  <property name="josm.home.dir"	value="${user.home}/.josm"/>
  <property name="josm"			location="../../core/dist/josm-custom.jar" />
  <property name="plugin.build.dir"	value="build"/>
  <property name="plugin.dist.dir"	value="../dist"/>
  <property name="plugin.name"		value="${ant.project.name}"/>
  <property name="plugin.jar"		value="../dist/${plugin.name}.jar"/>

  <property name="ant.build.javac.target" value="1.5"/>
  

  <target name="dist" depends="compile">
    <!-- images -->
    <copy todir="build/images">
      <fileset dir="images" />
    </copy>
    
    <!-- create josm-custom.jar -->
    <jar destfile="${plugin.jar}" basedir="build">
      <manifest>
        <attribute name="Plugin-Class" value="slippymap.SlippyMapPlugin" />
        <attribute name="Plugin-Description" value="Displays a slippy map tile grid, and tile status info" />
      </manifest>
    </jar>
  </target>

  <target name="compile" depends="init">
    <javac srcdir="slippymap" classpath="../../core/dist/josm-custom.jar" destdir="build" />
  </target>
  
  <target name="init">
    <mkdir dir="${plugin.build.dir}" />
  </target>
  
  <target name="clean">
    <delete dir="${plugin.build.dir}" />
    <delete file="${plugin.jar}" />
  </target>
  
</project>
