ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Smith <>
Subject uptodate with a target directory
Date Tue, 07 Mar 2006 17:00:18 GMT
uptodate does not seem to handle target directories properly.  It  
will incorrectly determine that a generated directory with an out-of- 
date timestamp is actually up to date.  Example script:

<project name="test-uptodate">

   <target name="update-source" >
     <touch file="source" />
     <echo message="Source updated.  Target is out of date." />

   <target name="update-target" depends="check-generate"  
unless="generated" >
     <delete dir="target" />
     <mkdir dir="target" />

   <fileset id="source-files" dir="${basedir}" includes="source" />

   <target name="check-generate">
     <uptodate property="generated" targetfile="target">
       <srcfiles refid="source-files" />


If, in an empty directory, I do the following:
- ant update-source (to generate the source file)
- ant update-target (to generate the target directory)
- ant update-source (to change the timestamp on the source file)
- ant update-target (to generate a *new* target directory)

On the second "update-target" uptodate incorrectly determines that  
the directory is up to date.

If I modify my script to do the following:
  <uptodate property="generated" srcfile="source" targetfile="target" />
it will work as expected.

It also works as expected if I generate a target *file* instead of a  
target *directory*.

I'm using Ant 1.6.2 and Java 1.5.0_05.

—Dan Smith

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message