Name
propertyfile
Synopsis
Creates or edits Java properties files. This task can add and edit entries. It does not preserve existing properties file comments.
Attributes
-
comment
(1.3, 1.4, String, N) A comment to add to the properties file.
-
file
(1.3, 1.4, File, Y) The name of the properties file to create or modify.
Content
- 0..n nested
<entry>
elements (1.3, 1.4) Each entry defines a name-value pair to write to or modify in the properties file. The following attributes are supported:
-
default
(1.3, 1.4, String, N) Initial value for a property if it is not already defined. For a
date
type, the value may also be set tonow
ornever
to indicate the current time or a null time respectively. Perhaps surprisingly, if a property does not exist and bothdefault
andvalue
are specified,value
is assigned to the property rather thandefault
.-
key
(1.3, 1.4, String, Y) The property name.
-
operation
(1.3, 1.4, Enum, N) Controls how the
value
attribute modifies the property value indicated by thekey
attribute. One of+
or=
for all data types, and also-
fordate
andint
types.+
performs addition,=
performs assignment, and-
performs subtraction.-
pattern
(1.3, 1.4, String, N) Controls how
date
andint
types are formatted. UsesSimpleDateFormat
andDecimalFormat
, respectively.-
type
(1.3, 1.4, Enum, N) Legal values are
int
, date
, andstring
. Defaults tostring
.-
value
(1.3, 1.4, String, Y) Specifies a value to add, subtract, or assign to/from the property specified by
key
. Works with theoperation
attribute. ...
-
Get Ant: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.