## Uptodate

### Description

Sets a property if a target files are more up to date than a set of Source files. Source files are specified by nested <srcfiles> elements, these are FileSets, while target files are specified using a nested mapper element.

The value part of the property being set is true if the timestamp of the target files is more recent than the timestamp of every corresponding source file.

The default behavior is to use a merge mapper with the `to` attribute set to the value of the targetfile attribute.

Normally, this task is used to set properties that are useful to avoid target execution depending on the relative age of the specified files.

### Parameters

Attribute | Description | Required
property | the name of the property to set. | Yes
value | the value to set the property to. Defaults to "true". | No
targetfile | the file for which we want to determine the status. | Yes, unless a nested mapper element is present.

### Examples

      <uptodate property="xmlBuild.notRequired" targetfile="${deploy}\xmlClasses.jar" >
        <srcfiles dir= "${src}/xml" includes="**/*.dtd"/>
      </uptodate>

sets the property `xmlBuild.notRequired` to the value "true" if the ${deploy}/xmlClasses.jar is more up to date than any of the DTD files in the ${src}/xml directory.

This can be written as

      <uptodate property="xmlBuild.notRequired"  >
        <srcfiles dir= "${src}/xml" includes="**/*.dtd"/>
        <mapper type="merge" to="${deploy}\xmlClasses.jar"/>
      </uptodate>

as well.

Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.