The <modified>
selector computes a value for a file, compares that to the value
stored in a cache and select the file, if these two values differ.
Because this selector is highly configurable the order in which the selection is done is:
The comparison, computing of the hashvalue and the store is done by implementation of special interfaces. Therefore they may provide additional parameters.
Table G.13: Attributes for the <modified>
selector
Name | Description | Default | Required |
---|---|---|---|
algorithm | The type of algorithm should be used. Acceptable values are (further information see later):
| hashfile | No |
cache | The type of cache should be used. Acceptable values are (further information see later):
| propertyfile | No |
comparator | The type of comparator should be used. Acceptable values are:
| equal | No |
algorithmclass | Classname of custom algorithm implementation. Lower priority than algorithm. | n/a | No |
cacheclass | Classname of custom cache implementation. Lower priority than cache. | n/a | No |
comparatorclass | Classname of custom comparator implementation. Lower priority than comparator. | n/a | No |
update | Should the cache be updated when values differ? (boolean) | true | No |
seldirs | Should directories be selected? (boolean) | true | No |
delayupdate | If set to "true", the storage of the cache will be delayed until the next finished BuildEvent; task finished, target finished or build finished, whichever comes first. This is provided for increased performance. If set to "false", the storage of the cache will happen with each change. This attribute depends upon the update attribute. (boolean) | true | No |
All attributes of a <modified> selector an be set with nested <param/> tags. Additional values can be set with <param/> tags according to the rules below.
Table G.14: algorithm
Name | Description | Default | Required |
---|---|---|---|
hashfile | This Algorithm supports the following attribute:
| n/a | No |
lastmodified | Uses the lastModified property of a file. No additional configuration is required. | n/a | No |
Here are some examples of how to use the Modified Selector:
<copy todir="dest"> <fileset dir="src"> <modified/> </fileset> </copy>
This will copy all files from src to dest which content has changed. Using an updating PropertyfileCache with cache.properties and MD5-FilehashAlgorithm.
<copy todir="dest"> <fileset dir="src"> <modified update="true" seldirs="true" cache="propertyfile" algorithm="digest" comparator="equal"> <param name="cache.cachefile" value="cache.properties"/> <param name="algorithm.algorithm" value="md5"/> </modified> </fileset> </copy>