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

Reply via email to