You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2005/11/08 17:29:30 UTC

DO NOT REPLY [Bug 37405] New: - optional delimiter attribute to the Replace task

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37405>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37405

           Summary: optional delimiter attribute  to the Replace task
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: shespelt@bear.com


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;

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org