diff --git a/WHATSNEW b/WHATSNEW
index f6ee4de53..0b044159a 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -12,6 +12,8 @@ Changes that could break older environments:
* can now work on s
+* now supports a value attribute
+
Other changes:
--------------
diff --git a/docs/manual/CoreTasks/uptodate.html b/docs/manual/CoreTasks/uptodate.html
index 658cdaffe..de5329206 100644
--- a/docs/manual/CoreTasks/uptodate.html
+++ b/docs/manual/CoreTasks/uptodate.html
@@ -34,6 +34,11 @@ execution depending on the relative age of the specified files.
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. |
diff --git a/src/main/org/apache/tools/ant/taskdefs/UpToDate.java b/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
index 9574c9abb..a898eff80 100644
--- a/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
+++ b/src/main/org/apache/tools/ant/taskdefs/UpToDate.java
@@ -74,6 +74,7 @@ import java.util.Vector;
public class UpToDate extends MatchingTask {
private String _property;
+ private String _value;
private File _targetFile;
private Vector sourceFileSets = new Vector();
@@ -89,6 +90,23 @@ public class UpToDate extends MatchingTask {
_property = property;
}
+ /**
+ * The value to set the named property to if the target file is more up to
+ * date than each of the source files. Defaults to 'true'.
+ *
+ * @param value the value to set the property to if Target is up to date
+ */
+ public void setValue(String value) {
+ _value = value;
+ }
+
+ /**
+ * Returns the value, or "true" if a specific value wasn't provided.
+ */
+ private String getValue() {
+ return ( _value != null ) ? _value : "true";
+ }
+
/**
* The file which must be more up to date than each of the source files
* if the property is to be set.
@@ -145,7 +163,7 @@ public class UpToDate extends MatchingTask {
}
if (upToDate) {
- this.project.setProperty(_property, "true");
+ this.project.setProperty(_property, this.getValue());
if (mapperElement == null) {
log("File \"" + _targetFile.getAbsolutePath() + "\" is up to date.",
Project.MSG_VERBOSE);