using System.Xml;
using System.Xml.Schema;
using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
using Mono.XBuild.Framework;
using Mono.XBuild.CommandLine;
Reevaluate ();
}
-#if NET_4_0
ProcessBeforeAndAfterTargets ();
-#endif
if (targetNames == null || targetNames.Length == 0) {
if (defaultTargets != null && defaultTargets.Length != 0) {
return sb.ToString ();
}
-#if NET_4_0
void ProcessBeforeAndAfterTargets ()
{
var beforeTable = Targets.AsIEnumerable ()
expr.Parse (targets, ParseOptions.AllowItemsNoMetadataAndSplit);
return (string []) expr.ConvertTo (this, typeof (string []));
}
-#endif
[MonoTODO]
public string [] GetConditionedPropertyValues (string propertyName)
case "Choose":
AddChoose (xe, ip);
break;
+ case "ItemDefinitionGroup":
+ AddItemDefinitionGroup (xe);
+ break;
default:
- throw new InvalidProjectFileException (String.Format ("Invalid element '{0}' in project file '{1}'.", xe.Name, ip.FullFileName));
+ var pf = ip == null ? null : string.Format (" '{0}'", ip.FullFileName);
+ throw new InvalidProjectFileException (String.Format ("Invalid element '{0}' in project file{1}.", xe.Name, pf));
}
}
}
SetExtensionsPathProperties (DefaultExtensionsPath);
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
-#if NET_4_5
+#if XBUILD_12
// see http://msdn.microsoft.com/en-us/library/vstudio/hh162058(v=vs.120).aspx
if (effective_tools_version == "12.0") {
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath32", toolsPath, PropertyType.Reserved));
- string frameworkToolsPath = parentEngine.Toolsets [effective_tools_version].FrameworkToolsPath;
- if (frameworkToolsPath == null)
- throw new Exception (String.Format ("Invalid tools version '{0}', no framework tools path set for this.", effective_tools_version));
+
+ var frameworkToolsPath = ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version451);
+
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildFrameworkToolsPath", frameworkToolsPath, PropertyType.Reserved));
evaluatedProperties.AddProperty (new BuildProperty ("MSBuildFrameworkToolsPath32", frameworkToolsPath, PropertyType.Reserved));
}
{
// eval all the properties etc till the import
if (evaluate_properties) {
- groupingCollection.Evaluate (EvaluationType.Property);
- groupingCollection.Evaluate (EvaluationType.Choose);
+ groupingCollection.Evaluate (EvaluationType.Property | EvaluationType.Choose);
}
try {
PushThisFileProperty (importingProject != null ? importingProject.FullFileName : FullFileName);
{
// eval all the properties etc till the import group
if (evaluate_properties) {
- groupingCollection.Evaluate (EvaluationType.Property);
- groupingCollection.Evaluate (EvaluationType.Choose);
+ groupingCollection.Evaluate (EvaluationType.Property | EvaluationType.Choose);
}
string condition_attribute = xmlElement.GetAttribute ("Condition");
if (!ConditionParser.ParseAndEvaluate (condition_attribute, this))
}
}
+ void AddItemDefinitionGroup (XmlElement xmlElement)
+ {
+ string condition_attribute = xmlElement.GetAttribute ("Condition");
+ if (!ConditionParser.ParseAndEvaluate (condition_attribute, this))
+ return;
+
+ foreach (XmlNode xn in xmlElement.ChildNodes) {
+ // TODO: Add all nodes to some internal dictionary?
+ }
+ }
+
bool AddSingleImport (XmlElement xmlElement, string projectPath, ImportedProject importingProject, string from_source_msg)
{
Import import = new Import (xmlElement, projectPath, this, importingProject);
return default (T);
}
+ internal string ThisFileFullPath {
+ get { return this_file_property_stack.Peek (); }
+ }
+
// Used for MSBuild*This* set of properties
internal void PushThisFileProperty (string full_filename)
{