[xibuild] Handle "incorrectly" cased msbuild property names (#6202)

msbuild property names are case insensitive. While generating the custom
app.config, in `SetToolsetProperty(..)` we try to update the property if
it already exists. But the name lookup was case sensitive, thus causing
the lookup to fail, resulting in two entries for the same property name
differing only in case. Eg. `MSBuildSDKsPath` vs `MSBuildSdksPath`.

Fixed to ignore case.

Fixes https://github.com/mono/mono/issues/14765 .
This commit is contained in:
Ankit Jain 2019-06-03 23:47:50 -04:00 коммит произвёл Sebastien Pouliot
Родитель 7d67e0585c
Коммит 55c4073cb3
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -206,7 +206,7 @@ namespace xibuild {
SetToolsetProperty ("MSBuildExtensionsPath32", MSBuildExtensionsPath);
SetToolsetProperty ("MSBuildExtensionsPath64", MSBuildExtensionsPath);
SetToolsetProperty ("RoslynTargetsPath", Path.Combine (MSBuildBin, "Roslyn"));
SetToolsetProperty ("MSBuildSdksPath", MSBuildSdksPath);
SetToolsetProperty ("MSBuildSDKsPath", MSBuildSdksPath);
dstXml.Save (targetConfigFile);
return;
@ -228,7 +228,8 @@ namespace xibuild {
if (string.IsNullOrEmpty (value))
return;
var valueAttribute = toolsets.SelectSingleNode ($"property[@name='{name}']/@value");
// MSBuild property names are case insensitive
var valueAttribute = toolsets.SelectSingleNode ($"property[translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='{name.ToLowerInvariant()}']/@value");
if (valueAttribute != null) {
valueAttribute.Value = value;
} else {