From 6cbeee38fa5502baa5d75036ad2c0418cf808d56 Mon Sep 17 00:00:00 2001
From: Erik Hatcher
Date: Fri, 22 Feb 2002 01:53:36 +0000
Subject: [PATCH] Here goes: propertyfile refactoring to hopefully fix all
outstanding issues with it. "now" and "never" were removed as operations
(didn't make sense). "never" was removed as a value (it caused a null pointer
exception anyway).
Other code cleanup (axing "m_" prefixes).
Added "unit" attribute to defaulting to DAY. This was essentially the previous default, but it was far too confusing.
Test cases beefed up to consider several scenarios.
There may be more changes needed to satisfy other use cases, and certainly some previous (undocumented) behavior has been changed (for the better!).
Is there a use-case for "never" as a value?
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271503 13f79535-47bb-0310-9956-ffa450edef68
---
docs/manual/OptionalTasks/propertyfile.html | 28 +-
.../taskdefs/optional/propertyfile.xml | 43 ++
.../ant/taskdefs/optional/PropertyFile.java | 462 +++++++++---------
.../taskdefs/optional/PropertyFileTest.java | 37 ++
4 files changed, 330 insertions(+), 240 deletions(-)
diff --git a/docs/manual/OptionalTasks/propertyfile.html b/docs/manual/OptionalTasks/propertyfile.html
index 33285054d..c8c197d06 100644
--- a/docs/manual/OptionalTasks/propertyfile.html
+++ b/docs/manual/OptionalTasks/propertyfile.html
@@ -2,12 +2,11 @@
PropertyFile Task
-
-Ant PropertyFile Task User Manual
+PropertyFile
by
-Version 1.1 - 2001/01/28
Table of Contents
@@ -30,7 +28,7 @@
when wanting to make unattended modifications to configuration files for application
servers and applications. Currently, the task maintains a working property file with
the ability to add properties or make changes to existing ones. However, any comments
-are lost. Work is being done to make this task a bit more "human friendly".
+are lost.
@@ -77,7 +75,7 @@ elements to specify actual modifications to the property file itself.
default |
Initial value to set for a property if it is not
already defined in the property file.
- For type date, two additional keywords are allowed: "now" or "never". |
+ For type date, an additional keyword is allowed: "now"
type |
@@ -96,6 +94,24 @@ elements to specify actual modifications to the property file itself.
be parsed and formatted accordingly.
No |
+
+ unit |
+ The unit of the value to be applied to date +/- operations.
+ Valid Values are:
+
+ - millisecond
+ - second
+ - minute
+ - hour
+ - day (default)
+ - week
+ - month
+ - year
+
+ This only applies to date types using a +/- operation.
+ |
+ No |
+
The rules used when setting a property value are shown below. The
operation occurs after these rules are considered.
@@ -172,4 +188,4 @@ Concatenation of strings :
Copyright © 2001-2002 Apache Software Foundation. All rights
Reserved.
-