X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mcs%2Fclass%2FMicrosoft.Build.Engine%2FMicrosoft.Build.BuildEngine%2FBuildProperty.cs;h=f0936a3f65be3a40311e12ecc59e3300bfba0591;hb=b8285f3c9951354be07f693dd5996790d5764e3a;hp=beac4824396ea67c4a54b3a47c7b26343e4ebc49;hpb=64b342c4e8e28d219fb8b7ec26c64a6c59ec4dc5;p=mono.git diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs index beac4824396..f0936a3f65b 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs @@ -27,14 +27,14 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#if NET_2_0 - using System; using System.Text; using System.Xml; +using System.Collections.Generic; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; +using Mono.XBuild.Utilities; namespace Microsoft.Build.BuildEngine { public class BuildProperty { @@ -80,7 +80,7 @@ namespace Microsoft.Build.BuildEngine { this.propertyType = PropertyType.Normal; this.parentProject = parentProject; this.name = propertyElement.Name; - this.value = Utilities.UnescapeFromXml (propertyElement.InnerXml); + this.value = MSBuildUtils.UnescapeFromXml (propertyElement.InnerXml); this.isImported = false; } @@ -121,10 +121,8 @@ namespace Microsoft.Build.BuildEngine { BuildProperty evaluated = new BuildProperty (Name, Value); // In evaluate phase, properties are not expanded - Expression exp = new Expression (); - exp.Parse (Value, ParseOptions.None); - evaluated.finalValue = (string) exp.ConvertTo (parentProject, typeof (string), - ExpressionOptions.DoNotExpandItemRefs); + evaluated.finalValue = Expression.ParseAs (Value, ParseOptions.None, + parentProject, ExpressionOptions.DoNotExpandItemRefs); parentProject.EvaluatedProperties.AddProperty (evaluated); } @@ -173,8 +171,8 @@ namespace Microsoft.Build.BuildEngine { Expression exp = new Expression (); // in non-evaluation phase, properties are always expanded - exp.Parse (FinalValue, options == ExpressionOptions.ExpandItemRefs ? - ParseOptions.AllowItems : ParseOptions.None); + exp.Parse (FinalValue, ParseOptions.Split | (options == ExpressionOptions.ExpandItemRefs ? + ParseOptions.AllowItems : ParseOptions.None)); return (ITaskItem[]) exp.ConvertTo (project, typeof (ITaskItem[]), options); } finally { converting = false; @@ -242,6 +240,14 @@ namespace Microsoft.Build.BuildEngine { internal XmlElement XmlElement { get { return propertyElement; } } + + internal IEnumerable GetAttributes () + { + if (!FromXml) + yield break; + foreach (XmlAttribute attr in propertyElement.Attributes) + yield return attr.Value; + } } internal enum PropertyType { @@ -251,5 +257,3 @@ namespace Microsoft.Build.BuildEngine { Environment } } - -#endif