Hi all,
    I have to replace a name in the files in a directory and its
subdirectories. I wrote a task for it. But it is replacing tokens in
the directory which is specified in the dir attribute.

<project name="replaces" default="replaces" basedir=".">
    <target name="replaces">
        <replace dir="${basedir}" includes="**/file.txt">
            <replacetoken>Antony</replacetoken>
            <replacevalue>Paul</replacevalue>
        </replace>
    </target>
</project>

I enabled debugging on and it prints this. Note that no files are
matched by the scanner and the directory contains 2 file.txt in
different subdirectories. I veriifed it with Windows Search.


---------- Capture Output ----------
C:\Ant-1.6.2\bin\ant.bat  -d  -f=E:\work\java\ant\replace\build.xml 
Apache Ant version 1.6.2 compiled on July 16 2004
Buildfile: E:\work\java\ant\replace\build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.4 in: c:\jdk1.4.2\jre
Detected OS: Windows 2000
Adding reference: ant.ComponentHelper
Setting ro project property: ant.version -> Apache Ant version 1.6.2
compiled on July 16 2004
Setting ro project property: ant.file -> E:\work\java\ant\replace\build.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile E:\work\java\ant\replace\build.xml with URI =
file:///E:/work/java/ant/replace/build.xml
Setting ro project property: ant.project.name -> replaces
Adding reference: replaces
Setting ro project property: ant.file.replaces ->
E:\work\java\ant\replace\build.xml
Project base dir set to: E:\work\java\ant\replace
 +Target: 
 +Target: replaces
Build sequence for target `replaces' is [replaces]
Complete build sequence is [replaces, ]

replaces:
Could not load a dependent class
(com/sun/media/jai/codec/FileSeekableStream) for type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Could not load class
(org.apache.tools.ant.tasksdefs.cvslib.CvsVersion) for type cvsversion
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
fileset: Setup scanner in dir E:\work\java\ant\replace with
patternSet{ includes: [**/file.txt] excludes: [] }

BUILD SUCCESSFUL
Total time: 3 seconds

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

Reply via email to