+2010-01-12 Rodrigo B. de Oliveira <rodrigo@unity3d.com>
+
+ * Microsoft.Build.BuildEngine/BuildWhen.cs
+ * Test/Microsoft.Build.BuildEngine/BuildChooseTest.cs:
+ Support for PropertyGroup as a child of When and Otherwise
+
2009-08-20 Ankit Jain <jankit@novell.com>
* Microsoft.Build.Engine.dll.sources: Add tools/xbuild/SolutionParser.cs
groupingCollection.Add (big);
// FIXME: add nested chooses
} else if (xe.Name == "PropertyGroup") {
- BuildPropertyGroup bpg = new BuildPropertyGroup ();
+ BuildPropertyGroup bpg = new BuildPropertyGroup (xe, parentProject, null, true);
//bpg.BindToXml (xe);
groupingCollection.Add (bpg);
} else
Assert.AreEqual ("B", project.EvaluatedItems[0].Name, "A4");
Assert.AreEqual (1, project.EvaluatedItemsIgnoringCondition.Count, "A5");
}
+
+ [Test]
+ public void ChooseWhenPropertyGroup () {
+
+ string documentString = @"
+ <Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <Choose>
+ <When Condition=""'$(Configuration)' == ''"">
+ <PropertyGroup>
+ <Foo>Bar</Foo>
+ </PropertyGroup>
+ </When>
+ <Otherwise>
+ <PropertyGroup>
+ <Foo>Baz</Foo>
+ </PropertyGroup>
+ </Otherwise>
+ </Choose>
+ </Project>
+ ";
+
+ Engine engine = new Engine (Consts.BinPath);
+ Project project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ Assert.AreEqual ("Bar", project.GetEvaluatedProperty ("Foo"), "A1");
+ }
+
+ [Test]
+ public void ChooseOtherwisePropertyGroup () {
+
+ string documentString = @"
+ <Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <Choose>
+ <When Condition=""'$(Configuration)' == 'dummy'"">
+ <PropertyGroup>
+ <Foo>Bar</Foo>
+ </PropertyGroup>
+ </When>
+ <Otherwise>
+ <PropertyGroup>
+ <Foo>Baz</Foo>
+ </PropertyGroup>
+ </Otherwise>
+ </Choose>
+ </Project>
+ ";
+
+ Engine engine = new Engine (Consts.BinPath);
+ Project project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ Assert.AreEqual ("Baz", project.GetEvaluatedProperty ("Foo"), "A1");
+ }
}
}