// 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 {
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;
}
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<string> (Value, ParseOptions.None,
+ parentProject, ExpressionOptions.DoNotExpandItemRefs);
parentProject.EvaluatedProperties.AddProperty (evaluated);
}
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;
internal XmlElement XmlElement {
get { return propertyElement; }
}
+
+ internal IEnumerable<string> GetAttributes ()
+ {
+ if (!FromXml)
+ yield break;
+ foreach (XmlAttribute attr in propertyElement.Attributes)
+ yield return attr.Value;
+ }
}
internal enum PropertyType {
Environment
}
}
-
-#endif