ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <>
Subject Re: updated files
Date Tue, 08 Jan 2008 02:39:28 GMT
Exactly what are you attempting to do?

You need a comparison to see whether a file is up to date. For
example, a *.class file should be newer than the corresponding *.java

There are two mechanisms that can do this. You can use either the
standard <uptodate> task or the AntContrib <outofdate> task:

In the standard <uptodate> task, you give it a set of source files,
and one and only one target file. (For example, the source files are
your *.java files while the target is your *.jar file). A selected
property is set if everything is up to date.

The <outofdate> task allows you to get multiple targets against
multiple sources. Plus, allows you to define the action to take if
there is something out of date. As an added bonus, the <outofdate>
task can set a property that contains all the out of date source
files. You can print this property to get a listing of all the out of
date files:

<target name="out-of-date-target">
           <fileset dir="${source.dir}/>
           <fileset dir="${target.dir}"/>

   <echo message="Newer sources are ${newer.source.files}"/>

On Jan 7, 2008 5:22 PM, I am Who i am <> wrote:
> Hi All,
> How to list the files updated?

> I mean if i want to check the file is updated or not how to do it with ant?,
> i remember some time back seeing something like if="updated" may be i'm
> wrong...
> Please help me if  any one knows how to do it

David Weintraub

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

View raw message