You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by I am Who i am <ra...@gmail.com> on 2008/01/07 23:22:21 UTC

updated files

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

Re: updated files

Posted by David Weintraub <qa...@gmail.com>.
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
file.

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">
    <outofdate
        property="target.outofdate"
        outputsources="newer.source.files">
       <sourcefiles>
           <fileset dir="${source.dir}/>
      </sourcefiles>
      <targetfiles>
           <fileset dir="${target.dir}"/>
      </target>
   </outofdate>

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


On Jan 7, 2008 5:22 PM, I am Who i am <ra...@gmail.com> 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
qazwart@gmail.com

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