ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Smith <dlsm...@rice.edu>
Subject Re: uptodate with a target directory
Date Thu, 09 Mar 2006 19:33:13 GMT
I've tested this now under Ant 1.6.5, and on two different platforms;  
the same bug is present.  Can anyone confirm this bad behavior on  
their own system?  If there are no objections, I think I'll create a  
bug report.

For comparison, here is a full script that works correctly (notice  
that the only difference is in the "uptodate" command):


<project name="test-uptodate2">

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

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

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

   <target name="check-generate">
     <uptodate property="generated" targetfile="target"  
srcfile="source" />
   </target>

</project>


—Dan Smith


On Mar 7, 2006, at 2:04 PM, Daniel Smith wrote:

> 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>
>
>   <target name="update-target" depends="check-generate"  
> unless="generated" >
>     <delete dir="target" />
>     <mkdir dir="target" />
>   </target>
>
>   <fileset id="source-files" dir="${basedir}" includes="source" />
>
>   <target name="check-generate">
>     <uptodate property="generated" targetfile="target">
>       <srcfiles refid="source-files" />
>     </uptodate>
>   </target>
>
> </project>
>
>
> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message