tags:

views:

13

answers:

1

I'm creating build file for phing. The problem is that it must move a file which may not exist. If it doesn't I get BuildException "Could not find file ... to copy".

In the Ant there was a property failonerror which ignored the errors of move and copy tasks, but there is no similar property for phing move and copy tasks.

Move phing code:

<move file="no_such_file.txt" tofile="other_path.txt" overwrite="true" />

Is there any built in functionality to catch the errors using phing build? Or maybe it's possible to check on file existence before moving?

A: 

I have avoided the problem using such move task:

<move todir="${dir}" overwrite="true">
    <mapper type="glob" from="no_such_file.txt" to="other_path.txt"/>
    <fileset dir="${dir}" />
</move>
Gedrox