You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2001/11/04 20:56:39 UTC

DO NOT REPLY [Bug 4633] New: - Global filtering via "filtering" attribute does not work with copy task

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=4633>.
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=4633

Global filtering via "filtering" attribute does not work with copy task

           Summary: Global filtering via "filtering" attribute does not work
                    with copy task
           Product: Ant
           Version: 1.4.1
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: peterwlynch@yahoo.com


Global filtering does not work with copy task at all following instructions in 
the manual.

To reproduce, consider the following example:

1. Make a build.xml that contains the following:

<project name="test" default="test">
    <property file="build.properties" />
    <filterset id="filterconf" begintoken="@" endtoken="@">
	<filtersfile file="./test.properties"/>
    </filterset>
    <target name="test">
	<copy file="./test.file" tofile="./output" filtering="true">
        </copy>
    </target>
</project>


2. Create a file called test.properties that contains the following:

TEST_TOKEN=nobug

3. Create a file to copy called test.file that contains the folllowing:

Is there a bug?

@TEST_TOKEN@

4. Perform the following command:

ant -verbose

5. Output shows that the filter file is loaded initially, but there is no 
confirmation that replacement took place on test.file. Open the file called 
output and you will still see:

@TEST_TOKEN@

----------

no replacement was made!


I have confirmed a workaround although it seriously will bloat build files:

Write your copy tasks like this:


<copy file="./test.file" tofile="./output">
    <filterset begintoken="@" endtoken="@">
         <filtersfile file="./test.properties" />
    </filterset>
</copy>


In other words, nested filtersets still work, but the filtering attribute of 
the copy task does not.

-Peter

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>