From 65c667d14c4cd0200c361b2fc9efe7139d63daef Mon Sep 17 00:00:00 2001
From: Stefan Bodewig
Date: Tue, 18 Aug 2009 03:08:20 +0000
Subject: [PATCH] new islastmodified condition
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@805265 13f79535-47bb-0310-9956-ffa450edef68
---
WHATSNEW | 3 +
docs/manual/CoreTasks/conditions.html | 50 +++++
.../org/apache/tools/ant/taskdefs/Touch.java | 4 +-
.../taskdefs/condition/IsLastModified.java | 193 ++++++++++++++++++
.../tools/ant/types/conditions/antlib.xml | 6 +-
.../condition/islastmodified-test.xml | 118 +++++++++++
6 files changed, 370 insertions(+), 4 deletions(-)
create mode 100644 src/main/org/apache/tools/ant/taskdefs/condition/IsLastModified.java
create mode 100644 src/tests/antunit/taskdefs/condition/islastmodified-test.xml
diff --git a/WHATSNEW b/WHATSNEW
index 0a785878e..f7042cb1a 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -836,6 +836,9 @@ Other changes:
arbitrary JDBC connection properties.
Bugzilla Report 33452.
+ * A new islastmodified condition can check the last modified date of
+ resources.
+
Changes from Ant 1.7.0 TO Ant 1.7.1
=============================================
diff --git a/docs/manual/CoreTasks/conditions.html b/docs/manual/CoreTasks/conditions.html
index e49c07f92..e0ad40caf 100644
--- a/docs/manual/CoreTasks/conditions.html
+++ b/docs/manual/CoreTasks/conditions.html
@@ -1007,5 +1007,55 @@ is redundant and will be ignored.
<hasfreespace partition="c:" needed="100M"/>
+
+islastmodified
+
+Tests the last modified date of a resource. Since Ant
+1.8.0
+
+
+
+ Attribute |
+ Description |
+ Required |
+
+
+ millis |
+ Specifies the expected modification time of the resource
+ in milliseconds since midnight Jan 1 1970. |
+ Exactly one of the
+ two. |
+
+
+ datetime |
+ Specifies the expected modification time of the
+ resource. The special value "now" indicates the
+ current time. |
+
+
+ pattern |
+ SimpleDateFormat-compatible pattern string.
+ Defaults to MM/DD/YYYY HH:MM AM_or_PM or MM/DD/YYYY HH:MM:SS AM_or_PM.
+ |
+ No |
+
+
+ mode |
+ How to compare the timestamp. Accepted values
+ are "equals", "before", "not-before", "after" and "not-after".
+ | No, defaults to "equals". |
+
+
+
+The actual resource to test is specified as a nested element.
+
+
+ An example:
+
+
+<islastmodified dateTime="08/18/2009 04:41:19 AM" mode="not-before">
+ <file file="${file}"/>
+</islastmodified>
+