An interesting question, and one that is a bit more difficult to answer than I originally thought.
You can use the task <tstamp>to set the timestamp to five minutes:
<tstamp>
<format property="time_stamp"
offset="-5"
unit="minutes"
pattern="MM/dd/yyyy hh:mm:ss aa"/>
</tstamp>
Once you have this timestamp, you can use the last modified task condition <condition>to find out if a specific file has been updated since then. If you do not have a file, you can use the task <touch>to create it.
<condition property="has.been.modified">
<islastmodified dateTime="${time_stamp}" mode="after">
<file file="${touch.file}"/>
</islastmodified>
</condition>
The only problem is that the default properties are immutable. After that you cannot change them. Fortunately, you use ant-contriband ant-contribto change this using a task variable.
source
share