<replace>

The <replace> task enables you to replace a given string with a new value within a set of files.

For example, this task is useful to toggle the value of DEBUG in source code for test-level and production-level distributions.

The full list of <replace> attributes is given in Table 4.68.

Table 4.68. Table of <replace> Attributes
Attributes Description
Required
dir (if file is not specified) The directory containing the files to be searched or replaced.
file (if dir is not specified) The file to be searched or replaced.
propertyfile (if nested <replacefilter> is used) The property file to use when <replacefilter> elements specify properties.
token (unless nested <replacetoken> is used) The string to be replaced.
Optional
defaultexcludes ...

Get Ant Developer’s Handbook 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.