Kevin's requirements is exactly why I submitted the patch that allows
properties to be explicitly passed to a build file.  In the child build
file, the properties become 'read-only' (as if passed using
the -D:name=value command line parameter).

This would allow you to write something like:

main.build
----------
<property name="debug" value="false" />
<nant buildfile="foo.build" inheritall="false">
  <property name="debug" value="$debug" />
</nant>

foo.build
---------
<!-- can be overriden by command line or calling build file -->
<property name="debug" value="true" />

instead of:

main.build
----------
<property name="debug" value="false" />
<nant buildfile="foo.build" inheritall="true" />

foo.build:
----------
<ifnot propertyexists="debug">
  <property name="debug" value="true" />
</ifnot>

I prefer the first way, since it fits with the declarative nature of NAnt.
I also prefer the inputs to the child build file to be explicit, to avoid
leaking properties accidentally.    Not to mention compatibility (in spirit)
with Ant, which I wrote about previously on this list.

What does everybody else think?  How long will it be before we have a
<switch/> task?

Mark

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Scott
> Hernandez
> Sent: 22 July 2002 22:41
> To: 'Nant-Developers (E-mail)'
> Subject: RE: [nant-dev] IFTask PropertyMissing parameter?
>
>
> I'm not sure why multiple logical checks are a problem.
>
> Maybe the simplest solution is to create an <ifnot> which is really the
> if task checking !condition(s).
>
> Here is the code.
>
> class IfNotTask : IfTask
> {
>       protected override bool ConditionsTrue {
>               return !base.ConditionsTrue;
>       }
> }
>
> It would solve your problem by supplying the following syntax.
>
> <ifnot propertyexits="debug"/>
>



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to