-----Original Message-----
From: Cort Schaefer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 6:15 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [nant-dev] patch to support resolving properties from environment varsThis would be great and would allow for individual customizations per a developers environment.
-----Original Message-----
From: Ben Lowery [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 3:27 PM
To: [EMAIL PROTECTED]
Subject: [nant-dev] patch to support resolving properties from environment varsdon't know if people consider this worthwhile or not, but i find it very
handy when dealing with projects broken down into multiple buildfiles. the
patch allows nant to attempt to resolve properties not in the
PropertyDictionary from the Environment. So, if you have a property called
"build.dir" but it's not set in your project, but is set in your
environment, the property will be pulling in from the environment.here's the revised indexer, against /src/NAnt.Core/PropertyDictionary.cs
public virtual string this[string name] {
get {
string value = (string) Dictionary[(object) name];
if(null == value) {
//try to resolve from environment
value = System.Environment.GetEnvironmentVariable(name);
if(null!=value)
value =
ExpandProperties(System.Environment.ExpandEnvironmentVariables(value));
}
return value;
}
set {
if (!_readOnlyProperties.Contains(name)) {
Dictionary[name] = value;
}
}
}--b
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers
Title: Message
I
think it would cause problems. I never want to specify settings in the
environment. I want everything to be in the .build file. With this
patch, the environment would be silently used, without my
knowledge.
I
think you're better off having a task that sets a property from the
environment. That way the usage of environment variables is
explicit.
- [nant-dev] patch to support resolving properties from envir... Ben Lowery
- RE: [nant-dev] patch to support resolving properties f... Cort Schaefer
- RE: [nant-dev] patch to support resolving properties f... Smith, Eric V.
- RE: [nant-dev] patch to support resolving properties f... Cort Schaefer
- RE: [nant-dev] patch to support resolving properties f... Shaw, Gerry
- RE: [nant-dev] patch to support resolving properties f... Shaw, Gerry
- RE: [nant-dev] patch to support resolving properties f... Jorge Bermejo
