You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/08/17 11:58:00 UTC

DO NOT REPLY [Bug 49756] Copy doesn't support string resources

https://issues.apache.org/bugzilla/show_bug.cgi?id=49756

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2010-08-17 05:57:57 EDT ---
Just some notes - regardless of whether there is a bug or not:

I think your usage of sort is wrong for what you are trying to do, in the case
where the file exists, both resources compare equal and I don't think Ant
makes any guarantee as to which one will come out first.

If the file doesn't exist, it is considered smaller than the string (according
to the manual, haven't checked the code) and thus would come before the string.

You probably want something like

    <copy tofile="${dir}/somefile">
        <first>
            <union>
                <restrict>
                    <exists/>
                    <fileset file="${dir}/somefile"/>
                </restrict>
                <string value="default contents"/>
            </union>
        </first>
    </copy>

Re: properties in macrodef - take a look at the local task.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.