Author: msierad
Date: 2007-01-02 06:21:51 -0500 (Tue, 02 Jan 2007)
New Revision: 70342

Removed:
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/OldExpression.cs
Modified:
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImpl.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroupCollection.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildWhen.cs
   trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeType.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs
   trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
   trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs
   
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
   trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
Log:
2007-01-02  Marek Sieradzki  <[EMAIL PROTECTED]>

        * BuildWhen.cs, BuildPropertyGroupCollection.cs,
        BuildItemGroupCollection.cs, Project.cs, GroupingCollection.cs:
        GroupingCollection doesn't need Project reference.

        * BuildTask.cs, Target.cs, TaskEngine.cs, BatchingImpl.cs: Formatting

        * BuildItemGroup.cs: Added new readOnly parameter to ctor.
        (Project.EvaluatedItems is a read only item group.)
        (ReplaceWith): Added.

        * BuildPropertyGroup.cs (IsGlobal): Added. Setting a property in
        global property group causes reevaluation of its project.

        * Project.cs: ProcessXml () is internal and can be "safely" invoked by
        other classes.

        * OldExpression.cs: Removed.

        * BuildProperty.cs (Evaluate): Simplified.

        * ChangeType.cs (TemporaryTransform): Simplified.

        * BuildItem.cs: There are now 3 types of build items: from XML, having
        parent from XML, virtual. Added SplitParentItem ().



Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImpl.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImpl.cs
  2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImpl.cs
  2007-01-02 11:21:51 UTC (rev 70342)
@@ -59,13 +59,13 @@
                        string[] inputFiles, outputFiles;
                        DateTime oldestInput, youngestOutput;
                
-                       if (inputs == String.Empty) {
+                       if (inputs == String.Empty)
                                return true;
-                       }
-                       if (outputs == String.Empty) {
+                       
+                       if (outputs == String.Empty)
                                return true;
-                       }
                        
+                       
                        inputExpr = new Expression ();
                        inputExpr.Parse (inputs);
                        outputExpr = new Expression ();
@@ -74,29 +74,29 @@
                        inputFiles = (string[]) inputExpr.ConvertTo (project, 
typeof (string[]));
                        outputFiles = (string[]) outputExpr.ConvertTo (project, 
typeof (string[]));
                        
-                       if (inputFiles == null) {
+                       if (inputFiles == null)
                                return true;
-                       }
-                       if (outputFiles == null) {
+                       
+                       if (outputFiles == null)
                                return true;
-                       }
-                       if (inputFiles.Length == 0) {
+                       
+                       if (inputFiles.Length == 0)
                                return true;
-                       }
-                       if (outputFiles.Length == 0) {
+                       
+                       if (outputFiles.Length == 0)
                                return true;
-                       }
                        
-                       if (File.Exists (inputFiles [0])) {
+                       
+                       if (File.Exists (inputFiles [0])) 
                                oldestInput = File.GetLastWriteTime (inputFiles 
[0]);
-                       } else {
+                       else 
                                return true;
-                       }
-                       if (File.Exists (outputFiles [0])) {
+                       
+                       if (File.Exists (outputFiles [0]))
                                youngestOutput = File.GetLastWriteTime 
(outputFiles [0]);
-                       } else {
+                       else
                                return true;
-                       }
+                       
                                
                        foreach (string file in inputFiles) {
                                if (file.Trim () == String.Empty)
@@ -116,17 +116,14 @@
                                if (File.Exists (file.Trim ())) {
                                        if (File.GetLastWriteTime (file.Trim 
()) < youngestOutput)
                                                youngestOutput = 
File.GetLastWriteTime (file.Trim ());
-                               } else {
+                               } else
                                        return true;
-                               }
                        }
                        
-                       if (oldestInput > youngestOutput) {
+                       if (oldestInput > youngestOutput)
                                return true;
-                       }
-                       else {
+                       else
                                return false;
-                       }
                }
                
                // FIXME: should do everything from task batching 
specification, not just run task once

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs 
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs 
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -29,6 +29,7 @@
 
 using System;
 using System.Collections;
+using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.IO;
 using System.Text;
@@ -40,17 +41,19 @@
 namespace Microsoft.Build.BuildEngine {
        public class BuildItem {
 
+               BuildItemGroup  child_items;
                XmlElement      itemElement;
                string          finalItemSpec;
                bool            isImported;
                string          itemInclude;
                string          name;
                BuildItemGroup  parentItemGroup;
+               BuildItem       parent_item;
                //string                recursiveDir;
                IDictionary     evaluatedMetadata;
                IDictionary     unevaluatedMetadata;
 
-               private BuildItem ()
+               BuildItem ()
                {
                }
                
@@ -70,35 +73,42 @@
                        if (itemInclude == String.Empty)
                                throw new ArgumentException ("Parameter 
\"itemInclude\" cannot have zero length.");
 
-                       this.name = itemName;
-                       this.finalItemSpec = itemInclude;
+                       name = itemName;
+                       finalItemSpec = itemInclude;
                        this.itemInclude = itemInclude;
-                       this.unevaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
-                       this.evaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
+                       unevaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
+                       evaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
                }
                
                internal BuildItem (XmlElement itemElement, BuildItemGroup 
parentItemGroup)
                {
-                       this.isImported = false;
-                       this.unevaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
-                       this.evaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
+                       child_items = new BuildItemGroup ();
+                       isImported = parentItemGroup.IsImported;
+                       unevaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
+                       evaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable ();
                        this.parentItemGroup = parentItemGroup;
-                       BindToXml (itemElement);
+                       
+                       this.itemElement = itemElement;
+                       
+                       if (Include == String.Empty)
+                               throw new InvalidProjectFileException ("Item 
must have Include attribute.");
                }
                
                BuildItem (BuildItem parent)
                {
-                       this.isImported = parent.isImported;
-                       this.name = parent.name;
-                       this.parentItemGroup = parent.parentItemGroup;
-                       this.unevaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable (parent.unevaluatedMetadata);
-                       this.evaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable (parent.evaluatedMetadata);
+                       isImported = parent.isImported;
+                       name = parent.Name;
+                       parent_item = parent;
+                       parent_item.child_items.AddItem (this);
+                       parentItemGroup = parent.parentItemGroup;
+                       unevaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable (parent.unevaluatedMetadata);
+                       evaluatedMetadata = 
CollectionsUtil.CreateCaseInsensitiveHashtable (parent.evaluatedMetadata);
                }
                
                public void CopyCustomMetadataTo (BuildItem destinationItem)
                {
                        foreach (DictionaryEntry de in unevaluatedMetadata)
-                               destinationItem.SetMetadata ((string) de.Key, 
(string) de.Value);
+                               destinationItem.AddMetadata ((string) de.Key, 
(string) de.Value, false);
                }
                
                [MonoTODO]
@@ -117,9 +127,10 @@
 
                public string GetMetadata (string metadataName)
                {
-                       if (ReservedNameUtils.IsReservedMetadataName 
(metadataName))
-                               return ReservedNameUtils.GetReservedMetadata 
(FinalItemSpec, metadataName);
-                       else if (unevaluatedMetadata.Contains (metadataName))
+                       if (ReservedNameUtils.IsReservedMetadataName 
(metadataName)) {
+                               string metadata = 
ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName);
+                               return (metadataName.ToLower () == "fullpath") 
? Utilities.Escape (metadata) : metadata;
+                       } else if (unevaluatedMetadata.Contains (metadataName))
                                return (string) unevaluatedMetadata 
[metadataName];
                        else
                                return String.Empty;
@@ -127,7 +138,10 @@
                
                public bool HasMetadata (string metadataName)
                {
-                       return evaluatedMetadata.Contains (metadataName);
+                       if (ReservedNameUtils.IsReservedMetadataName 
(metadataName))
+                               return true;
+                       else
+                               return evaluatedMetadata.Contains 
(metadataName);
                }
 
                public void RemoveMetadata (string metadataName)
@@ -139,11 +153,7 @@
                                throw new ArgumentException (String.Format 
("\"{0}\" is a reserved item meta-data, and cannot be modified or deleted.",
                                        metadataName));
                        
-                       if (evaluatedMetadata.Contains (metadataName))
-                               evaluatedMetadata.Remove (metadataName);
-                       
-                       if (unevaluatedMetadata.Contains (metadataName))
-                               unevaluatedMetadata.Remove (metadataName);
+                       DeleteMetadata (metadataName);
                }
 
                public void SetMetadata (string metadataName,
@@ -165,30 +175,51 @@
                        if (ReservedNameUtils.IsReservedMetadataName 
(metadataName))
                                throw new ArgumentException (String.Format 
("\"{0}\" is a reserved item meta-data, and cannot be modified or deleted.",
                                        metadataName));
+
+                       if (FromXml) {
+                               XmlElement element = itemElement [metadataName];
+                               if (element == null) {
+                                       element = 
itemElement.OwnerDocument.CreateElement (metadataName, Project.XmlNamespace);
+                                       // FIXME treat as literal
+                                       element.InnerText = metadataValue;
+                                       itemElement.AppendChild (element);
+                               } else
+                                       element.InnerText = metadataValue;
+                       } else if (HasParent) {
+                               if (parent_item.child_items.Count == 1)
+                                       parent_item.SetMetadata (metadataName, 
metadataValue, treatMetadataValueAsLiteral);
+                               else {
+                                       SplitParentItem ();
+                                       parent_item.SetMetadata (metadataName, 
metadataValue, treatMetadataValueAsLiteral);
+                               }
+                       }
                        
-                       RemoveMetadata (metadataName);
-                       
-                       evaluatedMetadata.Add (metadataName, metadataValue);
+                       DeleteMetadata (metadataName);
+                       AddMetadata (metadataName, metadataValue, 
treatMetadataValueAsLiteral);
+               }
+
+               void AddMetadata (string name, string value, bool literal)
+               {
+                       if (parentItemGroup != null) {
+                               Expression e = new Expression ();
+                               e.Parse (value);
+                               evaluatedMetadata.Add (name, (string) 
e.ConvertTo (parentItemGroup.Project, typeof (string)));
+                       } else
+                               evaluatedMetadata.Add (name, Utilities.Unescape 
(value));
                                
-                       if (treatMetadataValueAsLiteral) {      
-                               unevaluatedMetadata.Add (metadataName, 
Utilities.Escape (metadataValue));
-                       } else
-                               unevaluatedMetadata.Add (metadataName, 
metadataValue);
+                       if (literal)
+                               unevaluatedMetadata.Add (name, Utilities.Escape 
(value));
+                       else
+                               unevaluatedMetadata.Add (name, value);
                }
-               
-               void BindToXml (XmlElement xmlElement)
+
+               void DeleteMetadata (string name)
                {
-                       if (xmlElement == null)
-                               throw new ArgumentNullException ("xmlElement");
+                       if (evaluatedMetadata.Contains (name))
+                               evaluatedMetadata.Remove (name);
                        
-                       this.itemElement = xmlElement;
-                       this.name = xmlElement.Name;
-                       
-                       if (Include == String.Empty)
-                               throw new InvalidProjectFileException ("Item 
must have Include attribute.");
-                       
-                       foreach (XmlElement xe in xmlElement.ChildNodes)
-                               this.SetMetadata (xe.Name, xe.InnerText);
+                       if (unevaluatedMetadata.Contains (name))
+                               unevaluatedMetadata.Remove (name);
                }
 
                internal void Evaluate (Project project, bool evaluatedTo)
@@ -198,6 +229,9 @@
                                this.finalItemSpec = Utilities.Unescape 
(itemInclude);
                                return;
                        }
+                       
+                       foreach (XmlElement xe in itemElement.ChildNodes)
+                               AddMetadata (xe.Name, xe.InnerText, false);
 
                        DirectoryScanner directoryScanner;
                        Expression includeExpr, excludeExpr;
@@ -238,21 +272,21 @@
                        if (evaluatedTo) {
                                project.EvaluatedItems.AddItem (bi);
        
-                               if (!project.EvaluatedItemsByName.ContainsKey 
(bi.name)) {
-                                       big = new BuildItemGroup (null, 
project, null);
-                                       project.EvaluatedItemsByName.Add 
(bi.name, big);
+                               if (!project.EvaluatedItemsByName.ContainsKey 
(bi.Name)) {
+                                       big = new BuildItemGroup (null, 
project, null, true);
+                                       project.EvaluatedItemsByName.Add 
(bi.Name, big);
                                } else {
-                                       big = project.EvaluatedItemsByName 
[bi.name];
+                                       big = project.EvaluatedItemsByName 
[bi.Name];
                                }
 
                                big.AddItem (bi);
                        }
 
-                       if 
(!project.EvaluatedItemsByNameIgnoringCondition.ContainsKey (bi.name)) {
-                               big = new BuildItemGroup (null, project, null);
-                               
project.EvaluatedItemsByNameIgnoringCondition.Add (bi.name, big);
+                       if 
(!project.EvaluatedItemsByNameIgnoringCondition.ContainsKey (bi.Name)) {
+                               big = new BuildItemGroup (null, project, null, 
true);
+                               
project.EvaluatedItemsByNameIgnoringCondition.Add (bi.Name, big);
                        } else {
-                               big = 
project.EvaluatedItemsByNameIgnoringCondition [bi.name];
+                               big = 
project.EvaluatedItemsByNameIgnoringCondition [bi.Name];
                        }
 
                        big.AddItem (bi);
@@ -293,6 +327,40 @@
                        }
                }
 
+               void SplitParentItem ()
+               {
+                       BuildItem parent = parent_item;
+                       List <BuildItem> list = new List <BuildItem> ();
+                       XmlElement insertAfter = parent.itemElement;
+                       foreach (BuildItem bi in parent.child_items) {
+                               BuildItem added = InsertElementAfter (parent, 
bi, insertAfter);
+                               insertAfter = added.itemElement;
+                               list.Add (added);
+                       }
+                       parent.parentItemGroup.ReplaceWith (parent, list);
+                       parent.itemElement.ParentNode.RemoveChild 
(parent.itemElement);                 
+               }
+
+               static BuildItem InsertElementAfter (BuildItem parent, 
BuildItem child, XmlElement insertAfter)
+               {
+                       BuildItem newParent;
+
+                       XmlDocument doc = parent.itemElement.OwnerDocument;
+                       XmlElement newElement = doc.CreateElement (child.Name, 
Project.XmlNamespace);
+                       newElement.SetAttribute ("Include", 
child.FinalItemSpec);
+                       if (parent.itemElement.HasAttribute ("Condition"))
+                               newElement.SetAttribute ("Condition", 
parent.itemElement.GetAttribute ("Condition"));
+                       foreach (XmlElement xe in parent.itemElement)
+                               newElement.AppendChild (xe.Clone ());
+                       parent.itemElement.ParentNode.InsertAfter (newElement, 
insertAfter);
+
+                       newParent = new BuildItem (newElement, 
parent.parentItemGroup);
+                       newParent.child_items.AddItem (child);
+                       child.parent_item = newParent;
+
+                       return newParent;
+               }
+
                public string Condition {
                        get {
                                if (FromXml)
@@ -303,7 +371,7 @@
                        set {
                                if (FromXml)
                                        itemElement.SetAttribute ("Condition", 
value);
-                               else
+                               else if (!HasParent)
                                        throw new InvalidOperationException 
("Cannot set a condition on an object not represented by an XML element in the 
project file.");
                        }
                }
@@ -331,14 +399,24 @@
                        get {
                                if (FromXml)
                                        return itemElement.GetAttribute 
("Include");
-                               else if (itemInclude != null)
+                               else if (HasParent)
+                                       return parent_item.Include;
+                               else
                                        return itemInclude;
-                               else
-                                       return finalItemSpec;
                        }
                        set {
                                if (FromXml)
                                        itemElement.SetAttribute ("Include", 
value);
+                               else if (HasParent) {
+                                       if (parent_item.child_items.Count == 1)
+                                               parent_item.Include = value;
+                                       else {
+                                               SplitParentItem ();
+                                               
+                                               parent_item.Include = value;
+                                       }
+                               } else
+                                       itemInclude = value;
                        }
                }
 
@@ -347,15 +425,46 @@
                }
 
                public string Name {
-                       get { return name; }
-                       set { name = value; }
+                       get {
+                               if (FromXml)
+                                       return itemElement.Name;
+                               else if (HasParent)
+                                       return parent_item.Name;
+                               else
+                                       return name;
+                       }
+                       set {
+                               if (FromXml) {
+                                       XmlElement newElement = 
itemElement.OwnerDocument.CreateElement (value, Project.XmlNamespace);
+                                       newElement.SetAttribute ("Include", 
itemElement.GetAttribute ("Include"));
+                                       newElement.SetAttribute ("Condition", 
itemElement.GetAttribute ("Condition"));
+                                       foreach (XmlElement xe in itemElement)
+                                               newElement.AppendChild 
(xe.Clone ());
+                                       itemElement.ParentNode.ReplaceChild 
(newElement, itemElement);
+                                       itemElement = newElement;
+                               } else if (HasParent)
+                                       if (parent_item.child_items.Count == 1)
+                                               parent_item.Name = value;
+                                       else {
+                                               SplitParentItem ();
+                                               parent_item.Name = value;
+                                       }
+                               else
+                                       name = value;
+                       }
                }
                
-               internal bool FromXml {
+               bool FromXml {
                        get {
                                return itemElement != null;
                        }
                }
+               
+               bool HasParent {
+                       get {
+                               return parent_item != null;
+                       }
+               }
        }
 }
 

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs
        2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs
        2007-01-02 11:21:51 UTC (rev 70342)
@@ -39,22 +39,24 @@
        public class BuildItemGroup : IEnumerable {
        
                List <BuildItem>        buildItems;
+               ImportedProject         importedProject;
+               XmlElement              itemGroupElement;
                GroupingCollection      parentCollection;
                Project                 parentProject;
-               ImportedProject         importedProject;
-               XmlElement              itemGroupElement;
+               bool                    read_only;
 
                public BuildItemGroup ()
-                       : this (null, null, null)
+                       : this (null, null, null, false)
                {
                }
                
-               internal BuildItemGroup (XmlElement xmlElement, Project 
project, ImportedProject importedProject)
+               internal BuildItemGroup (XmlElement xmlElement, Project 
project, ImportedProject importedProject, bool readOnly)
                {
                        this.buildItems = new List <BuildItem> ();
                        this.importedProject = importedProject;
                        this.itemGroupElement = xmlElement;
                        this.parentProject = project;
+                       this.read_only = readOnly;
                        
                        if (!FromXml)
                                return;
@@ -87,11 +89,13 @@
 
                        bi.Evaluate (null, true);
 
-                       buildItems.Add (bi);
+                       if (!read_only)
+                               buildItems.Add (bi);
 
                        return bi;
                }
                
+               [MonoTODO ("what about groups from xml?")]
                public void Clear ()
                {
                        buildItems = new List <BuildItem> ();
@@ -182,6 +186,13 @@
                                }
                        }
                }               
+
+               internal void ReplaceWith (BuildItem item, List <BuildItem> 
list)
+               {
+                       int index = buildItems.IndexOf (item);
+                       buildItems.RemoveAt (index);
+                       buildItems.InsertRange (index, list);
+               }
                
                [MonoTODO]
                // FIXME: whether we can invoke get_Condition on BuildItemGroup 
not based on XML

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroupCollection.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroupCollection.cs
      2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroupCollection.cs
      2007-01-02 11:21:51 UTC (rev 70342)
@@ -35,9 +35,9 @@
                        
                GroupingCollection      groupingCollection;
                
-               private BuildItemGroupCollection ()
+               BuildItemGroupCollection ()
                {
-                       groupingCollection = new GroupingCollection (null);
+                       groupingCollection = new GroupingCollection ();
                }
 
                internal BuildItemGroupCollection (GroupingCollection 
groupingCollection)

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
 2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
 2007-01-02 11:21:51 UTC (rev 70342)
@@ -42,7 +42,7 @@
                Project         parentProject;
                PropertyType    propertyType;
 
-               private BuildProperty ()
+               BuildProperty ()
                {
                }
 
@@ -112,15 +112,16 @@
 
                internal void Evaluate ()
                {
-                       if (FromXml) {
-                               Expression exp = new Expression ();
-                               exp.Parse (Value);
-                               finalValue = (string) exp.ConvertTo 
(parentProject, typeof (string));
-                               parentProject.EvaluatedProperties.AddProperty 
(this);
-                       }
+                       BuildProperty evaluated = new BuildProperty (Name, 
Value);
+
+                       Expression exp = new Expression ();
+                       exp.Parse (Value);
+                       evaluated.finalValue = (string) exp.ConvertTo 
(parentProject, typeof (string));
+
+                       parentProject.EvaluatedProperties.AddProperty 
(evaluated);
                }
 
-               private bool FromXml {
+               bool FromXml {
                        get {
                                return propertyElement != null;
                        }

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -37,6 +37,7 @@
 namespace Microsoft.Build.BuildEngine {
        public class BuildPropertyGroup : IEnumerable {
        
+               bool                    read_only;
                ImportedProject         importedProject;
                XmlElement              propertyGroup;
                GroupingCollection      parentCollection;
@@ -45,16 +46,17 @@
                Dictionary <string, BuildProperty>      propertiesByName;
 
                public BuildPropertyGroup ()
-                       : this (null, null, null)
+                       : this (null, null, null, false)
                {
                }
 
-               internal BuildPropertyGroup (XmlElement xmlElement, Project 
project, ImportedProject importedProject)
+               internal BuildPropertyGroup (XmlElement xmlElement, Project 
project, ImportedProject importedProject, bool readOnly)
                {
                        this.importedProject = importedProject;
                        this.parentCollection = null;
                        this.parentProject = project;
                        this.propertyGroup = xmlElement;
+                       this.read_only = readOnly;
 
                        if (FromXml) {
                                this.properties = new List <BuildProperty> ();
@@ -172,19 +174,27 @@
                        SetProperty (propertyName, propertyValue, false);
                }
                
+               // FIXME: add a test for SetProperty on property from xml
                public void SetProperty (string propertyName,
                                         string propertyValue,
                                         bool treatPropertyValueAsLiteral)
                {
-                       if (!propertiesByName.ContainsKey (propertyName)) {
-                               BuildProperty bp = new BuildProperty 
(propertyName, propertyValue);
-                               AddProperty (bp);
-                       }
+                       if (read_only)
+                               return;
+                       
+                       if (propertiesByName.ContainsKey (propertyName))
+                               propertiesByName.Remove (propertyName);
 
+                       BuildProperty bp;
                        if (treatPropertyValueAsLiteral)
-                               propertiesByName [propertyName].Value = 
Utilities.Escape (propertyValue);
+                               bp = new BuildProperty (propertyName, 
Utilities.Escape (propertyValue));
                        else
-                               propertiesByName [propertyName].Value = 
propertyValue;
+                               bp = new BuildProperty (propertyName, 
propertyValue);
+
+                       AddProperty (bp);
+
+                       if (IsGlobal)
+                               parentProject.ProcessXml ();
                }
                
                internal void Evaluate ()
@@ -238,6 +248,12 @@
                        }
                }
 
+               bool IsGlobal {
+                       get {
+                               return parentProject != null && propertyGroup 
== null;
+                       }
+               }
+
                public BuildProperty this [string propertyName] {
                        get {
                                if (FromXml)

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
  2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroupCollection.cs
  2007-01-02 11:21:51 UTC (rev 70342)
@@ -37,7 +37,7 @@
        
                private BuildPropertyGroupCollection ()
                {
-                       groupingCollection = new GroupingCollection (null);
+                       groupingCollection = new GroupingCollection ();
                }
 
                internal BuildPropertyGroupCollection (GroupingCollection 
groupingCollection)

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs 
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs 
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -143,21 +143,21 @@
                                taskElement.SetAttribute (parameterName, 
parameterValue);
                }
                
-               private void LogTaskStarted ()
+               void LogTaskStarted ()
                {
                        TaskStartedEventArgs tsea = new TaskStartedEventArgs 
("Task started.", null, parentTarget.Project.FullFileName,
                                parentTarget.Project.FullFileName, 
taskElement.Name);
                        
parentTarget.Project.ParentEngine.EventSource.FireTaskStarted (this, tsea);
                }
                
-               private void LogTaskFinished (bool succeeded)
+               void LogTaskFinished (bool succeeded)
                {
                        TaskFinishedEventArgs tfea = new TaskFinishedEventArgs 
("Task finished.", null, parentTarget.Project.FullFileName,
                                parentTarget.Project.FullFileName, 
taskElement.Name, succeeded);
                        
parentTarget.Project.ParentEngine.EventSource.FireTaskFinished (this, tfea);
                }
                
-               private ITask InitializeTask ()
+               ITask InitializeTask ()
                {
                        ITask task;
                        
@@ -168,7 +168,7 @@
                        return task;
                }
                
-               private IDictionary <string, string> GetParameters ()
+               IDictionary <string, string> GetParameters ()
                {
                        Dictionary <string, string> parameters = new Dictionary 
<string, string> ();
                        

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildWhen.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildWhen.cs 
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildWhen.cs 
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -41,7 +41,7 @@
                public BuildWhen (Project parentProject)
                {
                //      this.parentProject = parentProject;
-                       this.groupingCollection = new GroupingCollection 
(parentProject);
+                       this.groupingCollection = new GroupingCollection ();
                }
                
                public void BindToXml (XmlElement whenElement)

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog    
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog    
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -1,3 +1,30 @@
+2007-01-02  Marek Sieradzki  <[EMAIL PROTECTED]>
+
+       * BuildWhen.cs, BuildPropertyGroupCollection.cs,
+       BuildItemGroupCollection.cs, Project.cs, GroupingCollection.cs:
+       GroupingCollection doesn't need Project reference.
+
+       * BuildTask.cs, Target.cs, TaskEngine.cs, BatchingImpl.cs: Formatting
+
+       * BuildItemGroup.cs: Added new readOnly parameter to ctor.
+       (Project.EvaluatedItems is a read only item group.)
+       (ReplaceWith): Added.
+
+       * BuildPropertyGroup.cs (IsGlobal): Added. Setting a property in
+       global property group causes reevaluation of its project.
+
+       * Project.cs: ProcessXml () is internal and can be "safely" invoked by
+       other classes.
+
+       * OldExpression.cs: Removed.
+
+       * BuildProperty.cs (Evaluate): Simplified.
+
+       * ChangeType.cs (TemporaryTransform): Simplified.
+
+       * BuildItem.cs: There are now 3 types of build items: from XML, having
+       parent from XML, virtual. Added SplitParentItem ().
+
 2006-12-20  Marek Sieradzki  <[EMAIL PROTECTED]>
 
        * Utilities.cs: Added Unescape ().

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeType.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeType.cs
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeType.cs
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -37,10 +37,22 @@
 namespace Microsoft.Build.BuildEngine {
        internal class ChangeType {
        
-               private static string TemporaryTransform (object o, Type type)
+               static string TemporaryTransform (object o, Type type)
                {
-                       string output = String.Empty;
-                       if (type == typeof (bool)) {
+                       string output = null;
+
+                       if (type == typeof (string))
+                               output = (string) o;
+                       else if (type == typeof (bool) ||
+                                type == typeof (int) ||
+                                type == typeof (uint) ||
+                                type == typeof (float) ||
+                                type == typeof (double) ||
+                                type == typeof (DateTime)) {
+                               output = o.ToString ();
+
+                       }
+                       /*if (type == typeof (bool)) {
                                bool t = (bool) o;
                                output =  t.ToString (); 
                        } else if (type == typeof (string)) {
@@ -55,8 +67,7 @@
                        } else if (type == typeof (uint)) {
                                uint t = (uint) o;
                                output =  t.ToString ();
-                       } else {
-                       }
+                       }*/
                        return output;
                }
                
@@ -133,7 +144,7 @@
                        return big;
                }
                
-               private static string TransformToString (ITaskItem[] items)
+               static string TransformToString (ITaskItem [] items)
                {
                        string[] text = new string [items.Length];
                        int i = 0;
@@ -142,7 +153,7 @@
                        return String.Join (";", text);
                }
                
-               private static string TransformToString (ITaskItem item)
+               static string TransformToString (ITaskItem item)
                {
                        return item.ItemSpec;
                }

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -41,11 +41,9 @@
 
                LinkedList <object>     list;
                LinkedListNode <object> iterator;
-               Project project;
        
-               public GroupingCollection (Project project)
+               public GroupingCollection ()
                {
-                       this.project = project;
                        list = new LinkedList <object> ();
                        iterator = null;
                }

Deleted: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/OldExpression.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/OldExpression.cs
 2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/OldExpression.cs
 2007-01-02 11:21:51 UTC (rev 70342)
@@ -1,218 +0,0 @@
-//
-// OldExpression.cs: Stores references to items or properties.
-//
-// Author:
-//   Marek Sieradzki ([EMAIL PROTECTED])
-// 
-// (C) 2005 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// 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.IO;
-using System.Collections;
-using System.Text;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-/*namespace Microsoft.Build.BuildEngine {
-       internal class OldExpression {
-       
-               Project project;
-               ExpressionCollection expressionCollection;
-       
-               public OldExpression (Project project)
-               {
-                       this.project = project;
-                       this.expressionCollection = new ExpressionCollection ();
-               }
-
-               public void ParseSource (string source)
-               {
-                       // FIXME: change StringBuilder to substrings 
-                       if (source == null)
-                               throw new ArgumentNullException ("source");     
                        
-
-                       // FIXME: hack
-                       source = source.Replace ('/', 
Path.DirectorySeparatorChar);
-                       source = source.Replace ('\\', 
Path.DirectorySeparatorChar);
-                       StringBuilder temp = new StringBuilder ();
-                       CharEnumerator it = source.GetEnumerator ();
-                       EvaluationState eState = EvaluationState.Out;
-                       ParenState pState = ParenState.Out;
-                       ApostropheState aState = ApostropheState.Out;
-                       int start = 0;
-                       int current = -1;
-                       
-                       while (it.MoveNext ()) {
-                               current++;
-                               switch (eState) {
-                               case EvaluationState.Out:
-                                       switch (it.Current) {
-                                       case '@':
-                                               if (temp.Length > 0) {
-                                                       
expressionCollection.Add (temp.ToString ());
-                                                       
-                                                       temp = new 
StringBuilder ();
-                                               }
-                                               eState = EvaluationState.InItem;
-                                               start = current;
-                                               break;
-                                       case '$':
-                                               if (temp.Length > 0) {
-                                                       
expressionCollection.Add (temp.ToString ());
-                                                       temp = new 
StringBuilder ();
-                                               }
-                                               eState = 
EvaluationState.InProperty;
-                                               start = current;
-                                               break;
-                                       case '%':
-                                               if (temp.Length > 0) {
-                                                       
expressionCollection.Add (temp.ToString ());
-                                                       temp = new 
StringBuilder ();
-                                               }
-                                               eState = 
EvaluationState.InMetadata;
-                                               start = current;
-                                               break;
-                                       default:
-                                               temp.Append (it.Current);
-                                               if (current == source.Length - 
1)
-                                                       
expressionCollection.Add (temp.ToString ());
-                                               break;
-                                       }
-                                       break;
-                               case EvaluationState.InItem:
-                                       switch (it.Current) {
-                                       case '(':
-                                               if (pState == ParenState.Out && 
aState == ApostropheState.Out)
-                                                       pState = 
ParenState.Left;
-                                               else if (aState == 
ApostropheState.Out)
-                                                       throw new Exception 
("'(' not expected.");
-                                               break;
-                                       case ')':
-                                               if (pState == ParenState.Left 
&& aState == ApostropheState.Out) {
-                                                       ItemReference ir = new 
ItemReference (project);
-                                                       ir.ParseSource 
(source.Substring (start, current - start + 1));
-                                                       
expressionCollection.Add (ir);
-                                                       
-                                                       eState = 
EvaluationState.Out;
-                                                       pState = ParenState.Out;
-                                               }
-                                               break;
-                                       case '\'':
-                                               if (aState == 
ApostropheState.In)
-                                                       aState = 
ApostropheState.Out;
-                                               else
-                                                       aState = 
ApostropheState.In;
-                                               break;
-                                       default:
-                                               break;
-                                       }
-                                       break;
-                               case EvaluationState.InProperty:
-                                       switch (it.Current) {
-                                       case '(':
-                                               if (pState == ParenState.Out)
-                                                       pState = 
ParenState.Left;
-                                               else
-                                                       throw new Exception 
("'(' expected.");
-                                               break;
-                                       case ')':
-                                               if (pState == ParenState.Left) {
-                                                       PropertyReference pr = 
new PropertyReference (project);
-                                                       pr.ParseSource 
(source.Substring (start, current - start + 1));
-                                                       
expressionCollection.Add (pr);
-                                                       
-                                                       eState = 
EvaluationState.Out;
-                                                       pState = ParenState.Out;
-                                               }
-                                               break;
-                                       default:
-                                               break;
-                                       }
-                                       break;
-                               case EvaluationState.InMetadata:
-                                       switch (it.Current) {
-                                       case '(':
-                                               if (pState == ParenState.Out)
-                                                       pState = 
ParenState.Left;
-                                               break;
-                                       case ')':
-                                               if (pState == ParenState.Left) {
-                                                       MetadataReference mr = 
new MetadataReference ();
-                                                       mr.ParseSource 
(source.Substring (start, current - start + 1));
-                                                       
expressionCollection.Add (mr);
-                                                       
-                                                       eState = 
EvaluationState.Out;
-                                                       pState = ParenState.Out;
-                                               }
-                                               break;
-                                       default:
-                                               break;
-                                       }
-                                       break;
-                               default:
-                                       throw new Exception ("Invalid 
evaluation state.");
-                               }
-                       }
-               }
-               
-               public object ConvertTo (Type type)
-               {
-                       return expressionCollection.ConvertTo (type);
-               }
-
-               public Project Project {
-                       get { return project; }
-               }
-
-               public ExpressionCollection Collection {
-                       get { return expressionCollection; }
-               }
-       }
-
-       internal enum EvaluationState {
-               Out,
-               InItem,
-               InMetadata,
-               InProperty
-       }
-       
-       internal enum ParenState {
-               Out,
-               Left
-       }
-       
-       internal enum ApostropheState {
-               In,
-               Out
-       }
-       
-       internal enum ItemParsingState {
-               Name,
-               Transform1,
-               Transform2,
-               Separator
-       }
-}*/
-
-#endif

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs   
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs   
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -79,30 +79,20 @@
 
                public Project (Engine engine)
                {
-                       buildEnabled = engine.BuildEnabled;
                        parentEngine  = engine;
+
+                       buildEnabled = ParentEngine.BuildEnabled;
                        xmlDocument = new XmlDocument ();
-                       groupingCollection = new GroupingCollection (this);
-                       imports = new ImportCollection (groupingCollection);
-                       usingTasks = new UsingTaskCollection (this);
-                       itemGroups = new BuildItemGroupCollection 
(groupingCollection);
-                       propertyGroups = new BuildPropertyGroupCollection 
(groupingCollection);
-                       targets = new TargetCollection (this);
+                       xmlDocument.AppendChild (xmlDocument.CreateElement 
("Project", XmlNamespace));
+                       xmlDocument.DocumentElement.SetAttribute ("xmlns", ns);
                        
-                       taskDatabase = new TaskDatabase ();
-                       if (engine.DefaultTasksRegistered) {
-                               taskDatabase.CopyTasks (engine.DefaultTasks);
-                       }
-                       
-                       globalProperties = new BuildPropertyGroup ();
                        fullFileName = String.Empty;
 
-                       foreach (BuildProperty bp in 
parentEngine.GlobalProperties) {
+                       globalProperties = new BuildPropertyGroup (null, this, 
null, false);
+                       foreach (BuildProperty bp in 
parentEngine.GlobalProperties)
                                GlobalProperties.AddProperty (bp.Clone (true));
-                       }
-
-                       // You can evaluate an empty project.
-                       Evaluate ();
+                       
+                       ProcessXml ();
                }
 
                [MonoTODO]
@@ -500,17 +490,25 @@
                        }
                }
 
-               void ProcessXml ()
+               internal void ProcessXml ()
                {
-                       XmlElement xmlElement = xmlDocument.DocumentElement;
-                       if (xmlElement.Name != "Project")
-                               throw new InvalidProjectFileException ("Invalid 
root element.");
-                       if (xmlElement.GetAttributeNode ("DefaultTargets") != 
null)
-                               defaultTargets = xmlElement.GetAttribute 
("DefaultTargets").Split (';');
+                       groupingCollection = new GroupingCollection ();
+                       imports = new ImportCollection (groupingCollection);
+                       usingTasks = new UsingTaskCollection (this);
+                       itemGroups = new BuildItemGroupCollection 
(groupingCollection);
+                       propertyGroups = new BuildPropertyGroupCollection 
(groupingCollection);
+                       targets = new TargetCollection (this);
+                       
+                       taskDatabase = new TaskDatabase ();
+                       if (ParentEngine.DefaultTasksRegistered)
+                               taskDatabase.CopyTasks 
(ParentEngine.DefaultTasks);     
+
+                       if (xmlDocument.DocumentElement.GetAttributeNode 
("DefaultTargets") != null)
+                               defaultTargets = 
xmlDocument.DocumentElement.GetAttribute ("DefaultTargets").Split (';');
                        else
                                defaultTargets = new string [0];
                        
-                       ProcessElements (xmlElement, null);
+                       ProcessElements (xmlDocument.DocumentElement, null);
                        
                        isDirty = false;
                        Evaluate ();
@@ -557,11 +555,11 @@
                
                internal void Evaluate ()
                {
-                       evaluatedItems = new BuildItemGroup (null, this, null);
-                       evaluatedItemsIgnoringCondition = new BuildItemGroup 
(null, this, null);
+                       evaluatedItems = new BuildItemGroup (null, this, null, 
true);
+                       evaluatedItemsIgnoringCondition = new BuildItemGroup 
(null, this, null, true);
                        evaluatedItemsByName = new Dictionary <string, 
BuildItemGroup> (StringComparer.InvariantCultureIgnoreCase);
                        evaluatedItemsByNameIgnoringCondition = new Dictionary 
<string, BuildItemGroup> (StringComparer.InvariantCultureIgnoreCase);
-                       evaluatedProperties = new BuildPropertyGroup ();
+                       evaluatedProperties = new BuildPropertyGroup (null, 
null, null, true);
 
                        InitializeProperties ();
 
@@ -572,7 +570,7 @@
                                usingTask.Evaluate ();
                }
 
-               private void InitializeProperties ()
+               void InitializeProperties ()
                {
                        BuildProperty bp;
 
@@ -625,13 +623,13 @@
                
                void AddItemGroup (XmlElement xmlElement, ImportedProject 
importedProject)
                {
-                       BuildItemGroup big = new BuildItemGroup (xmlElement, 
this, importedProject);
+                       BuildItemGroup big = new BuildItemGroup (xmlElement, 
this, importedProject, false);
                        ItemGroups.Add (big);
                }
                
                void AddPropertyGroup (XmlElement xmlElement, ImportedProject 
importedProject)
                {
-                       BuildPropertyGroup bpg = new BuildPropertyGroup 
(xmlElement, this, importedProject);
+                       BuildPropertyGroup bpg = new BuildPropertyGroup 
(xmlElement, this, importedProject, false);
                        PropertyGroups.Add (bpg);
                }
                
@@ -698,12 +696,12 @@
                public BuildPropertyGroup GlobalProperties {
                        get { return globalProperties; }
                        set {
-                               if (value == null) {
+                               if (value == null)
                                        throw new ArgumentNullException 
("value");
-                               }
-                               if (value.FromXml) {
+                               
+                               if (value.FromXml)
                                        throw new InvalidOperationException 
("Can't do that.");
-                               }
+                               
                                globalProperties = value;
                        }
                }

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs    
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs    
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -136,7 +136,7 @@
                                }
                        
                                if (result)
-                                       result = RealBuild ();
+                                       result = DoBuild ();
                        } catch (Exception) {
                                return false;
                        } finally {
@@ -146,7 +146,7 @@
                        return result;
                }
                
-               private bool RealBuild ()
+               bool DoBuild ()
                {
                        bool executeOnErrors = false;
                        bool result = true;
@@ -174,7 +174,7 @@
                        return result;
                }
                
-               private void ExecuteOnErrors ()
+               void ExecuteOnErrors ()
                {
                        foreach (XmlElement onError in onErrorElements) {
                                // FIXME: add condition
@@ -186,7 +186,7 @@
                        }
                }
 
-               private void LogTargetSkipped ()
+               void LogTargetSkipped ()
                {
                        BuildMessageEventArgs bmea;
                        bmea = new BuildMessageEventArgs (String.Format 
("Skipping target \"{0}\" because its outputs are up-to-date.",
@@ -194,7 +194,7 @@
                        engine.EventSource.FireMessageRaised (this, bmea);
                }
                
-               private void LogTargetStarted ()
+               void LogTargetStarted ()
                {
                        TargetStartedEventArgs tsea;
                        string projectFile = project.FullFileName;
@@ -202,7 +202,7 @@
                        engine.EventSource.FireTargetStarted (this, tsea);
                }
                
-               private void LogTargetFinished (bool succeeded)
+               void LogTargetFinished (bool succeeded)
                {
                        TargetFinishedEventArgs tfea;
                        string projectFile = project.FullFileName;

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
===================================================================
--- 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
    2007-01-02 11:06:07 UTC (rev 70341)
+++ 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
    2007-01-02 11:21:51 UTC (rev 70342)
@@ -126,7 +126,7 @@
                                propertyInfo = taskType.GetProperty 
(taskParameter);
                                if (propertyInfo == null)
                                        throw new Exception ("Could not get 
property info.");
-                               if (propertyInfo.IsDefined (outputAttribute, 
false) == false)
+                               if (!propertyInfo.IsDefined (outputAttribute, 
false))
                                        throw new Exception ("This is not 
output property.");
                                
                                o = propertyInfo.GetValue (task, null);
@@ -141,12 +141,12 @@
                        }
                }
                
-               private void InitializeParameter (PropertyInfo propertyInfo, 
object value)
+               void InitializeParameter (PropertyInfo propertyInfo, object 
value)
                {
                        propertyInfo.SetValue (task, value, null);
                }
 
-               private void PublishItemGroup (PropertyInfo propertyInfo,
+               void PublishItemGroup (PropertyInfo propertyInfo,
                                               object o,
                                               string itemName)
                {
@@ -164,7 +164,7 @@
                                parentProject.EvaluatedItems.AddItem (bi);
                }
                
-               private void PublishProperty (PropertyInfo propertyInfo,
+               void PublishProperty (PropertyInfo propertyInfo,
                                              object o,
                                              string propertyName)
                {
@@ -172,7 +172,7 @@
                        parentProject.EvaluatedProperties.AddProperty (bp);
                }
                
-               private BuildProperty CollectProperty (PropertyInfo 
propertyInfo, object o, string name)
+               BuildProperty CollectProperty (PropertyInfo propertyInfo, 
object o, string name)
                {
                        string output = null;
                        BuildProperty bp;
@@ -201,7 +201,7 @@
                        return bp;
                }
                
-               private BuildItemGroup CollectItemGroup (PropertyInfo 
propertyInfo, object o, string name)
+               BuildItemGroup CollectItemGroup (PropertyInfo propertyInfo, 
object o, string name)
                {
                        BuildItemGroup big;
                        string temp;
@@ -230,7 +230,7 @@
                        return big;     
                }
                                
-               private object GetObjectFromString (string raw, Type type)
+               object GetObjectFromString (string raw, Type type)
                {
                        Expression e;
                        object result;

Modified: 
trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
===================================================================
--- trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources   
2007-01-02 11:06:07 UTC (rev 70341)
+++ trunk/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources   
2007-01-02 11:21:51 UTC (rev 70342)
@@ -42,7 +42,6 @@
 Microsoft.Build.BuildEngine/InvalidProjectFileException.cs
 Microsoft.Build.BuildEngine/ItemReference.cs
 Microsoft.Build.BuildEngine/MetadataReference.cs
-Microsoft.Build.BuildEngine/OldExpression.cs
 Microsoft.Build.BuildEngine/Project.cs
 Microsoft.Build.BuildEngine/PropertyPosition.cs
 Microsoft.Build.BuildEngine/PropertyReference.cs

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to