> While looking through the code, though, I noticed that the code in
> PropertyDictionary's indexer is:
> 
> set {
>   if (!_readOnlyProperties.Contains(name)) {
>     Dictionary[name] = value;
>   }
> }
> 
> Now, this will silently be ignored if the property is 
> readonly. Somehow, I
> don't think this is good behavior; it's confusing at best. Even more
> cumbersome is the fact that some of the code is relying on this wicked
> behavior. For example, unit tests for NAnt.Console actually 
> _check_ for this
> silent change attempts to be ignored.
> 
> Any comments?

This behavior is for this situation:  In your build file you define a
property (ie, debug) to have a default value.

  <property name="debug" value="true"/>

And you use that property in your build file.  You then want to override
that property on the command line so you use:

  nant -D:debug=false


The nant console will add all properties on the command line as
readonly.  When the <property name="debug" value="true"/> task gets
executed the property will not be set to true but keep the value
specified on the command line.

I believe this is a valid use case but I share your concerns about the
subtle nature this might cause.  I'm open to ideas to solve this.


-------------------------------------------------------
This sf.net email is sponsored by:
Access Your PC Securely with GoToMyPC. Try Free Now
https://www.gotomypc.com/s/OSND/DD
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to