Bug 37405 - optional delimiter attribute to the Replace task
Summary: optional delimiter attribute to the Replace task
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.2
Hardware: All All
: P2 enhancement with 1 vote (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-08 17:29 UTC by Steve Hespelt
Modified: 2008-11-24 03:58 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Hespelt 2005-11-08 17:29:29 UTC
When using the replacefilterfile attribute, it would be handy to be able to
specify what delimiter should be used. Unfortunately, someone here has already
created a good number of config files using the pattern  #property.name# so one
would have to first create the temporary property file argument to
replacefilterfile with the delimeters appended/prepended. I've made a simple
change that allows for an optional attribute (default value "@@") to do this
prepending/appending when retrieving the token from the set of properties loaded
from the replacefilterfile file.
This way, a property file could be used as is and allow the Replace task to
create the 'correct' pattern.
Here is the diff:
[shespelt_cr16875] racssv05:62> diff Replace.java.orig Replace.java
60a61
>     private String delimiter="@@";
238c239,245
<                     replaceFilter.setToken(token);
---
>                     if ( token.startsWith( this.delimiter ) ) {
>                         replaceFilter.setToken(token);
>                     } else {
>                         // this allows for our replacefilterfile to be a
simple property file
>                         replaceFilter.setToken( this.delimiter + token +
this.delimiter );
>                     }
>
503a511,514
>     }
>
>     public void setDelimiter( String delim ) {
>         delimiter = delim;