On 8/19/05, Sandeep <[EMAIL PROTECTED]> wrote:
> I would like to ignore the error in <if> task (generated by test condition)
> if the file is locked. I tried adding failonerror="false" but it still
> breaks the build. 
> 
> Can you please tell me how to make build successful even if some files being
> passed to file::is-assembly(listFileName) in my <if> task are locked. 
> 
> Thanks in advance, 
> 
> Sandeep 

Sandeep,

You can use the <trycatch> task in NantContrib to wrap your <if>
statement and ignore the error... note that any errors from inside the
if block will also be caught by this.

Alternatively, you may be able to separate the test and the condition
by storing the result of the condition in a property, and then
performing the test on the contents of the property:

<property name="testresult" value="${file::get-length(listFileName)
&gt; 0 and file::is-assembly(listFileName)}" failonerror="false"/>
<if test="${testresult}"> ... </if>


Hope that helps,


-- 
Troy


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to