Name

replace

Synopsis

Performs string replacement in one or more files. The original files are replaced rather than copied.

Attributes

defaultexcludes (all, boolean, N)

Determines whether to use default excludes, as described in Chapter 4 under “FileSet DataType.” Defaults to true.

dir (all, File, *)

The base directory used when specifying multiple files.

excludes (all, String, N)

A comma-separated list of file patterns to exclude. These are in addition to the default excludes.

excludesfile (all, File, N)

The name of a file containing one exclude pattern per line.

file (all, File, *)

An individual file to perform replacements in.

includes (all, String, N)

A comma-separated list of file patterns to include.

includesfile (all, File, N)

The name of a file containing one include pattern per line.

propertyfile (1.3, 1.4, File, *)

Specifies a properties file containing properties referenced by nested <replacefilter> elements.

summary (1.4, boolean, N)

If true, display a summary report of this operation. Defaults to false.

token (all, String, *)

The token to replace.

value (all, String, N)

The new value for the token. Defaults to an empty string.

Exactly one of file or dir is required. The token attribute is required if a nested <replacetoken> element is used. The propertyfile attribute is required if the property attribute of a nested <replacefilter> element is specified.

Content

0..n nested patternset elements: <exclude>, <include>, <patternset> (all); <excludesfile>, <includesfile> (1.4)

Used in place ...

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.