<?xml version="1.0"?>

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

  <target name="test1">
    <dependset/>
  </target>

  <target name="test2">
    <dependset>
      <srcfilelist dir="." includes="test2.tmp"/>
    </dependset>
  </target>

  <target name="test3">
    <dependset>
      <targetfileset dir="." files="test3.tmp"/>
    </dependset>
  </target>

  <target name="test4">
    <touch file="test4.tmp"/>
    <dependset>
      <srcfilelist dir="." files="test4.tmp"/>
      <targetfileset id="targetfs" dir="." includes="i-do-not-exist"/>
    </dependset>
  </target>

  <target name="test5">
    <touch file="older.tmp"/>
    <sleep seconds="3" />
    <touch file="newer.tmp"/>
    <dependset>
      <srcfilelist dir="." files="newer.tmp"/>
      <targetfilelist dir="." files="older.tmp"/>
    </dependset>
    <fail>
      <condition>
        <available file="older.tmp" />
      </condition>
    </fail>
  </target>

  <target name="test6">
    <touch file="older.tmp"/>
    <sleep seconds="3" />
    <touch file="newer.tmp"/>
    <dependset>
      <sources>
        <file file="newer.tmp" />
      </sources>
      <targets>
        <filelist dir="." files="older.tmp" />
      </targets>
    </dependset>
    <fail>
      <condition>
        <available file="older.tmp" />
      </condition>
    </fail>
  </target>

  <target name="test7">
    <touch file="older.tmp"/>
    <dependset>
      <sources>
        <propertyresource name="thereisnosuchproperty" />
      </sources>
      <targets>
        <filelist dir="." files="older.tmp" />
      </targets>
    </dependset>
    <fail>
      <condition>
        <available file="older.tmp" />
      </condition>
    </fail>
  </target>

  <target name="test8">
    <touch file="older.tmp" />
    <property name="foo" value="bar" />
    <dependset>
      <sources>
        <propertyresource name="foo" />
      </sources>
      <targets>
        <filelist dir="." files="older.tmp" />
      </targets>
    </dependset>
    <fail>
      <condition>
        <not>
          <available file="older.tmp" />
        </not>
      </condition>
    </fail>
  </target>

  <target name="cleanup"> 
    <delete file="test4.tmp"/>
    <delete file="older.tmp"/>
    <delete file="newer.tmp"/>
  </target>
</project>
