Stefan,

I have made the extension to the UpToDate Task so that it extends from
the MatchingTask.
This allows specification of the source files using the patterns from
the MatchingTask.

I have also included html User Doco for it.

William Ferguson

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this E-mail are the
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.

UpToDate

Description

Sets a property if a Target file is more up to date than a set of Source files.

It is possible to refine the set of Source files. This can be done with the includes, includesfile, excludes, excludesfile and defaultexcludes attributes. With the includes or includesfile attribute you specify the files you want to have included by using patterns. The exclude or excludesfile attribute is used to specify the files you want to have excluded. This is also done with patterns. And finally with the defaultexcludes attribute, you can specify whether you want to use default exclusions or not. See the section on directory based tasks, on how the inclusion/exclusion of files works, and how to write patterns. The patterns are relative to the src directory.

The value part of the property being set is true if the timestamp of the Target file is more recent than the timestamp of every Source file.

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
targetFile the file for which we want to determine the status. Yes
srcDir the base directory from which to locate the Source files. Yes
includes comma separated list of patterns of files that must be included. All files are included when omitted. No
includesfile the name of a file. Each line of this file is taken to be an include pattern No
excludes comma separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted. No
excludesfile the name of a file. Each line of this file is taken to be an exclude pattern No
defaultexcludes indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted. No

Examples

  <upToDate property="xmlBuild.notRequired" 
            targetFileName="${deploy}\xmlClasses.jar" 
            srcDir="${src}/xml" 
            includes="**/*.dtd" />

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.


Attachment: UpToDate.java
Description: Binary data

Reply via email to