Hi Gert,
Regarding your example, my feeling is that there would be very natural, if
fileset "files" would be empty and nothing would be copied. I would consider
this example as a logical error of the programmer, who created such file. As
we have just discussed nant is sequential. So when fileset was created
include.text was false ->fileset will be empty. 


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gary Feldman
Sent: Montag, 31. Juli 2006 17:59
To: nant-users@lists.sourceforge.net
Subject: Re: [NAnt-users] Evaluation of if and unless

Gert Driesen wrote:
> ...
>>>
>> What's the issue with this?  This problem comes up often enough.  The 
>> intuitive sense of the if and unless attributes is that they should 
>> always be evaluated first, and if the result is to skip the task, 
>> then absolutely nothing else should happen - no other property 
>> evaluations, no validity checks on other attribute values, etc.
> ...
>
> Consider this following (incomplete) build fragment:
>
> <project default="build">
>    <property name="include.text" value="false" />
>
>    <fileset id="files">
>        <include name="*.txt" if="${incliude.text}">
>    </fileset>
>
>    <target name="build">
>        <property name="include.text" value="true" />
>        <copy ....>
>            <fileset refid="files" />
>        </copy>
>    </target>
> </project>
>
> If we chose to ignore elements based on the if/unless attribute during 
> initialization, then the <include> element of the fileset will not be 
> initialized. NAnt will first initialize global types/tasks, and at 
> that moment "include.text" is false.
This sounds like a case for dynamic filesets, just like the distinction
between dynamic and regular properties.  Of course, that's much easier said
than done.

Gary


-------------------------------------------------------------------------
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


-------------------------------------------------------------------------
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