diff --git a/WHATSNEW b/WHATSNEW index c74bc9d98..4afe691bb 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -45,6 +45,16 @@ Other changes: of the source files are no longer required to be at the end of the command. +* Ant now prints a warning when an attempt is made to use a property which has + not been set. Any build files which rely on non-set properties being passed + through untranslated will now break. + +* Added a failonerror to the javac task. If set to false, the build will continue + even if there are compilation errors. + +* Added nested format elements to the tstamp task allowing additional time formats + to be defined for arbitrary properties. + Fixed bugs: ----------- diff --git a/docs/index.html b/docs/index.html index 23a1ecce9..c56fa9c31 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3099,6 +3099,13 @@ inclusion/exclusion of files works, and how to write patterns.

tracking for compilers that support this (jikes and classic) No + + failonerror + If set to false, the build will continue even if there are compilation errors. + Defaults to true. + + No +

Parameters specified as nested elements

@@ -4673,9 +4680,49 @@ initialization target.

Description Required + No parameters + + + +

Nested Elements

+The tstamp task supports a format nested element which allows a property to be +given the current date and time in a given format. The date/time patterns are as defined in the Java +SimpleDateFormat class. +

+ + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
property + The property which is to receive the date/time string in the given pattern + Yes
patternThe date/time pattern to be used. The values are defined by the Java + SimpleDateFormat classYes
+

Examples

+

Set the standard DSTAMP, TSTAMP and TODAY properties according to the formats above

  <tstamp/>
+ +

As for the above example, set the standard properties and also set the property +"TODAY_UK" with the date/time pattern "d MMM yyyy" + +

  <tstamp>
+    <format property="TODAY_UK" pattern="d MMMM yyyy">
+  </tstamp>
+
+

Uptodate

Description

diff --git a/src/main/org/apache/tools/ant/taskdefs/Tstamp.java b/src/main/org/apache/tools/ant/taskdefs/Tstamp.java index e60a09e6c..ab948509f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Tstamp.java +++ b/src/main/org/apache/tools/ant/taskdefs/Tstamp.java @@ -123,6 +123,14 @@ public class Tstamp extends Task { public void execute(Project project, Date date) { + if (propertyName == null) { + throw new BuildException("property attribute must be provided", location); + } + + if (pattern == null) { + throw new BuildException("pattern attribute must be provided", location); + } + SimpleDateFormat sdf = new SimpleDateFormat (pattern); project.setProperty(propertyName, sdf.format(date)); }