John,
 
You can use NAnt's filterchain for this purpose.
 
For an example, see Example III:
http://nant.sourceforge.net/release/latest/help/tasks/copy.html
 
You probably would better use the <expandproperties> filter instead of
<replacetokens>.
 
For example:
 
<copy todir="../backup/dir">
    <fileset basedir="src_dir">
        <include name="**/*" />
    </fileset>
    <filterchain>
        <expandproperties />
    </filterchain>
</copy>

Your input file would have to contain tokens in this form:
${property name}
 
eg. ${product.version}
 
Note:
For now, there's no support for in-place replacing of tokens. You have to
use tasks like <copy> or <move>.
 
Hope this helps,
 
Gert

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Stotler
Sent: dinsdag 16 oktober 2007 18:43
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] a search and replace question



We have an in-house python script that we've been using for our token
replacement, but I'm looking at moving us entirely over to nant.

 

What our script does is load a token/properties file, and then search
through a file or folder replacing any instances it finds of each token.

 

It looks like in nant I'm going to have to specify each token to be replaced
in the .build file.

 

Am I wrong about this? Is there a way to do an automated replace like our
current script does?

 

 

Thanks,

John

 

 

****************************************

John Stotler
Deployment Engineer

TopCoder
703 Hebron Avenue
Glastonbury, CT 06033
www.TopCoder.com <http://www.topcoder.com/> 

 

+1 203.654.7659 (Cell)
+1 860.657.4276 (Corporate FAX)

 

DISCLAIMER NOTE: TopCoder wishes to inform you that the total content of
this e-mail is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. If you
are not the intended recipient of this message you are hereby notified that
any use, review, retransmission, dissemination, distribution, reproduction
whether orally or through any other media and/or any action taken upon this
message is prohibited. If you received this in error, please contact the
sender and delete the material from any computer.

 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to