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

<!--
Build file for Rhino using Ant (see http://jakarta.apache.org/ant/index.html)
Requires Ant version 1.2
-->
<project name="toolsrc" default="compile" basedir="..">

  <target name="properties">
    <property file="build.properties"/>
    <property name="debugger"
              value="org/mozilla/javascript/tools/debugger"/>
  </target>

  <target name="compile" depends="properties">
    <ant dir="toolsrc/${debugger}" target="download"/>
    <javac srcdir="toolsrc"
           destdir="${classes}"
           includes="org/**/*.java"
           deprecation="on"
           debug="${debug}"
	   target="${target-jvm}"
 	   source="${source-level}"
	   >
    </javac>
    <copy todir="${classes}">
      <fileset dir="toolsrc" includes="org/**/*.properties" />
    </copy>
  </target>

  <target name="copy-source" depends="properties">
    <mkdir dir="${dist.dir}/toolsrc"/>
    <copy todir="${dist.dir}/toolsrc">
      <fileset dir="toolsrc"
               includes="**/*.java,**/*.properties,**/*.xml"
               excludes="${debugger}/downloaded/**" />
    </copy>
  </target>

  <target name="clean" depends="properties">
    <delete includeEmptyDirs="true">
      <fileset dir="${classes}"
               includes="org/mozilla/javascript/tools/**"/>
    </delete>
  </target>

</project>
