[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ant-user
Subject:    Re: Replacing tokens without token delimiters
From:       "Lieve Van den Heuvel" <lvandenheuvel () vangenechten ! com>
Date:       2005-02-10 13:24:54
Message-ID: s20b6eda.013 () cs_imas ! priv ! vangenechten ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi
 
Have you tried the replace task?  I've used it to change data in a file
as well:
<replace dir="${project.build.dir}/${hibernate.dir.name}"
token="$FRAMEWORK_VERSION" value="${framework.version}">
            <include name="**/*.cfg.xml"/>
        </replace>

maybe this helps..
 
Greetings
Lieve
>>> laurent.leconte@francetelecom.com 10/02/2005 14:15:45 >>>

Hello all,

we've recently decided to replace all our shell scripts with ant tasks,
and I'm currently faced with the following problem: I need to replace
arbitrary strings in a number of source files with different values,
e.g. "http://www.foo.com" would be replaced by "http://test.bar.net",
"prod.value=5" by "test.value=10", etc. 
The problem is that the strings to be changed aren't clearly (i.e. with
a distinctive begin/end character) delimited in the source files.

I have a property file where all the strings to be replaced, as well as
their new values, are defined. I've tried to do this :

<copy todir="${new.dir}">
    <fileset refid="filesToBeChanged"/>
    <filterset begintoken="" endtoken="">
        <filtersfile file="${my.property.file}"/>
    </filterset>
</copy>

However, this fails because filterset won't accept empty delimiters.
I've thought of using the replace task instead, but I can't define the
tokens to be replaced using a property file: I have to list them all by
hand in the build.xml file. Is there any way to avoid listing all the
replacement strings in the build.xml file and still use the replace
task?

Thanks in advance.

Laurent Leconte

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





["TEXT.htm" (application/octet-stream)]
["InterScan_Disclaimer.txt" (text/plain)]

Privileged Confidential Information may be contained in this message.
If you are not the addressee indicated in this message (or responsible for delivery of 
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by reply 
email. Please advise immediately if you or your employer does not consent to Internet 
email for messages of this kind. Opinions, conclusions and other information in this 
message that do not relate to the official business of my firm shall be understood 
as neither given nor endorsed by it.




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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic