You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by broken connection <br...@gmail.com> on 2007/08/23 18:36:18 UTC

How to perform substituion and replacement tasks together??

Hi Friends,
I copy  files from "src" directory to "dest" directory using this target.

build.xml:

    <filter filtersfile="test.properties"/>

    <target name="test">
        <copy todir="${dest}/test" filtering="true">
            <fileset dir="${src}/test">
            </fileset>
        </copy>
    </target>

I have a property file with this parameter:
test.properties:
    logs.location=C:\Tomcat\logs

This is the parameter that i would like to substitue:
Log4j.xml file in ${src}/test:
    <!ENTITY logFile "@logs.location@">

I would like to convert the backslashes into slashes i.e i want to use this
propertyregex expression:

<propertyregex property="${logs.location}" input="${src}/test" regexp="\"
replace="/" override="true" />

But I don't understand how to use it so that both the value substitution
from the properties file and the replacement
takes place together, can somebody give any clues please....

Thanks