Add some tests to evaluate IntermediateOutputPath.
properties = new List<ProjectProperty> ();
foreach (DictionaryEntry p in Environment.GetEnvironmentVariables ())
- this.properties.Add (new EnvironmentProjectProperty (this, (string)p.Key, (string)p.Value));
+ // FIXME: this is kind of workaround for unavoidable issue that PLATFORM=* is actually given
+ // on some platforms and that prevents setting default "PLATFORM=AnyCPU" property.
+ if (!string.Equals ("PLATFORM", (string) p.Key, StringComparison.OrdinalIgnoreCase))
+ this.properties.Add (new EnvironmentProjectProperty (this, (string)p.Key, (string)p.Value));
foreach (var p in GlobalProperties)
this.properties.Add (new GlobalProjectProperty (this, p.Key, p.Value));
var tools = ProjectCollection.GetToolset (this.ToolsVersion) ?? ProjectCollection.GetToolset (this.ProjectCollection.DefaultToolsVersion);
properties = new List<ProjectPropertyInstance> ();
foreach (DictionaryEntry p in Environment.GetEnvironmentVariables ())
- this.properties.Add (new ProjectPropertyInstance ((string) p.Key, false, (string) p.Value));
+ // FIXME: this is kind of workaround for unavoidable issue that PLATFORM=* is actually given
+ // on some platforms and that prevents setting default "PLATFORM=AnyCPU" property.
+ if (!string.Equals ("PLATFORM", (string) p.Key, StringComparison.OrdinalIgnoreCase))
+ this.properties.Add (new ProjectPropertyInstance ((string) p.Key, false, (string) p.Value));
foreach (var p in global_properties)
this.properties.Add (new ProjectPropertyInstance (p.Key, false, p.Value));
var tools = projects.GetToolset (tools_version) ?? projects.GetToolset (projects.DefaultToolsVersion);
Assert.AreEqual ("1+1+2", new Project (root).GetProperty ("C").EvaluatedValue, "#1");
Assert.AreEqual ("1+1+2", new ProjectInstance (root).GetProperty ("C").EvaluatedValue, "#1");
}
+
+ [Test]
+ public void PlatformPropertyEmptyByDefault ()
+ {
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003' />";
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ var proj = new Project (root);
+ Assert.IsNull (proj.GetProperty ("PLATFORM"), "#1");
+ }
}
}
Assert.IsNotNull ("Baz", proj.ItemsIgnoringCondition.Last ().ItemType, "#3");
}
+ [Test]
+ public void EvaluateSamePropertiesInOrder ()
+ {
+ // used in Microsoft.Common.targets
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <PropertyGroup>
+ <BaseIntermediateOutputPath Condition=""'$(BaseIntermediateOutputPath)' == ''"">obj\</BaseIntermediateOutputPath>
+ </PropertyGroup>
+</Project>";
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ var proj = new Project (root);
+ Assert.AreEqual ("obj\\", proj.GetPropertyValue ("BaseIntermediateOutputPath"), "#1");
+ }
+
[Test]
public void DirtyMarking ()
{