<?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="src" default="compile" basedir="..">

  <property file="build.properties"/>

  <target name="compile">
    <javac srcdir="src"
           destdir="${classes}"
           includes="org/**/*.java"
           deprecation="on"
           debug="${debug}"
	   target="${target-jvm}"
	   source="${source-level}"
	   >
    </javac>
    <copy todir="${classes}">
      <fileset dir="src" includes="org/**/*.properties" />
      <filterset>
	  <filter token="IMPLEMENTATION.VERSION" 
	          value="${implementation.version}"/>
      </filterset>      
    </copy>
  </target>

  <target name="copy-source">
    <mkdir dir="${dist.dir}/src"/>
    <copy todir="${dist.dir}/src">
      <fileset dir="src"
               includes="**/*.java,**/*.properties,**/*.xml,manifest"/>
    </copy>
  </target>

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

</project>
