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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5146

The Replace Task - possible extension to the property file feature

           Summary: The Replace Task - possible extension to the property
                    file feature
           Product: Ant
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


I am using the Replace Task for replacing different stuff in configuration 
files.

It works fine.

My problem, so to speek is the ammount of code I have to create to do all the 
replaces, and if I decide on using a new key to be replaced, I must add it in 
all the places I want to use it (Am I right here?).

A suggestion could be to do the following:

have two new attributes:

 preoken        (Example: '#@')
 aPreToken      (Example: '@#')

and use the properties file somewhat differently, say:

 for all the keys in the file, set up a replaceFilter internally.

Say my properties file contains:

#
 db.user        = charles
 db.pwd         = dickens
 verbose        = false
 debug          = false
# etc.

Then create Filters accordingly:

(If I would write them today:)

      <replacefilter token="[EMAIL PROTECTED]@#"    property="db.user"/>
      <replacefilter token="[EMAIL PROTECTED]@#"     property="db.pwd"/>
      <replacefilter token="[EMAIL PROTECTED]@#"    property="verbose"/>
      <replacefilter token="[EMAIL PROTECTED]@#"      property="debug"/>

Now I can extend the replaced kjeys just by adding new entries in the 
properties file.

Is this something you also beleive is useful?

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to