<?xml version="1.0"?>

<project name="ant-test" basedir="." default="test1">

  <path id="inheritable">
    <pathelement path="${java.class.path}" />
  </path>

  <target name="cleanup">
    <delete file="test1.log" />
    <delete file="test2.log" />
    <delete file="ant/test3.log" />
    <delete file="ant/test4.log" />
  </target>

  <target name="all" depends="test1,test2,test3,test4"/>

  <target name="test1">
    <ant antfile="ant.xml" dir="." target="test1"/>
  </target>

  <target name="test2">
    <antcall/>
  </target>

  <target name="test3">
    <antcall target="test3"/>
  </target>

  <target name="test4">
    <antcall target=""/>
  </target>

  <target name="test5">
    <antcall target="dummy"/>
  </target>

  <target name="test6">
    <ant antfile="ant.xml" dir="." target="dummy"/>
  </target>

  <target name="dummy">
  </target>

  <target name="inheritBasedir">
    <ant antfile="ant/ant.xml" target="dummy" inheritAll="true" />
  </target>

  <target name="doNotInheritBasedir">
    <ant antfile="ant/ant.xml" target="dummy" inheritAll="false" />
  </target>

  <target name="explicitBasedir1">
    <ant antfile="taskdefs/ant/ant.xml" target="dummy" inheritAll="true" 
         dir=".." />
  </target>

  <target name="explicitBasedir2">
    <ant antfile="taskdefs/ant/ant.xml" target="dummy" inheritAll="false" 
         dir=".." />
  </target>

  <target name="tripleCall">
    <ant antfile="ant/ant.xml" target="callback" inheritAll="false" />
  </target>

  <target name="testInherit">
    <ant antfile="ant/references.xml" inheritRefs="true" target="dummy" />
  </target>

  <target name="testNoInherit">
    <ant antfile="ant/references.xml" inheritRefs="false" target="dummy" />
  </target>

  <target name="testRename">
    <ant antfile="ant/references.xml" inheritRefs="false" target="dummy">
      <reference refid="path" torefid="newpath" />
    </ant>
  </target>

  <target name="testLogfilePlacement">
    <ant antfile="ant.xml" target="dummy" output="test1.log"
         inheritall="false" />
    <ant antfile="ant.xml" target="dummy" output="test2.log" />
    <ant antfile="ant.xml" target="dummy" output="test3.log"
         inheritall="false" dir="ant" />
    <ant antfile="ant.xml" target="dummy" output="test4.log" 
         dir="ant" />
  </target>

  <target name="testRefid">
    <ant antfile="ant/references.xml" inheritRefs="false" target="dummy">
      <property name="testprop" refid="inheritable" />
    </ant>
  </target>

  <target name="test-property-override-inheritall-start">
    <property name="test" value="1" />
    <ant antfile="ant.xml"
         target="test-property-override-inheritall-level-2"
         inheritall="true">
      <property name="test" value="2" />
    </ant>
  </target>

  <target name="test-property-override-inheritall-level-2">
    <property name="test" value="3" />
    <ant antfile="ant.xml"
         target="test-property-override-inheritall-level-3"
         inheritall="true">
      <property name="test" value="4" />
    </ant>
  </target>

  <target name="test-property-override-inheritall-level-3">
    <property name="test" value="5" />
    <echo message="The value of test is ${test}" />
  </target>

  <target name="test-property-override-no-inheritall-start">
    <property name="test" value="1" />
    <ant antfile="ant.xml"
         target="test-property-override-no-inheritall-level-2"
         inheritall="false">
      <property name="test" value="2" />
    </ant>
  </target>

  <target name="test-property-override-no-inheritall-level-2">
    <property name="test" value="3" />
    <ant antfile="ant.xml"
         target="test-property-override-no-inheritall-level-3"
         inheritall="false">
      <property name="test" value="4" />
    </ant>
  </target>

  <target name="test-property-override-no-inheritall-level-3">
    <property name="test" value="5" />
    <echo message="The value of test is ${test}" />
  </target>
</project>
