ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5146] New: - The Replace Task - possible extension to the property file feature
Date Tue, 27 Nov 2001 21:41:30 GMT
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: ant-dev@jakarta.apache.org
        ReportedBy: hp@hirsch.pp.se
                CC: hp@hirsch.pp.se


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="#@db.user@#"    property="db.user"/>
      <replacefilter token="#@db.pwd@#"     property="db.pwd"/>
      <replacefilter token="#@verbose@#"    property="verbose"/>
      <replacefilter token="#@debug@#"      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:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message