Yes, that is intended behavior.
 
Think of a task, such as <include>,  as a subroutine call.  The compiler
(or, in this case, the XML interpreter) evaluates ALL arguments to the
call, then passes the values to the subroutine.  It is the internal
execution of the subroutine that knows what if=false means, so it
doesn't include the file.
 
If you want to conditionalize the include based on the existence of the
file to be included, then you are going to have to wrap and
unconditional <include> inside an <if> statement.
 
Merrill
 
________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stephane
Hamel
Sent: Thursday, February 15, 2007 12:52 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] bug in fileset ?
 
Hi,
 
The following script doesn't work if the property test.file is not set.
Is it the intended behavior?
 
    <delete>
      <fileset>
        <include if="${property::exists('test.file')}"
name="${test.file}"/>
      </fileset>
    </delete>
 
 
 
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to