Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions tests/xharness/ProjectFileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ public static void SetTopLevelPropertyGroupValue (this XmlDocument csproj, strin

public static void RemoveTargetFrameworkIdentifier (this XmlDocument csproj)
{
RemoveNode (csproj, "TargetFrameworkIdentifier");
try {
RemoveNode (csproj, "TargetFrameworkIdentifier");
} catch {
// ignore exceptions, if not present, we are not worried
}
}

public static void SetAssemblyName (this XmlDocument csproj, string value)
Expand Down Expand Up @@ -549,13 +553,15 @@ static void FindAndReplace (XmlNodeList nodes, string find, string replace)
public static void FixInfoPListInclude (this XmlDocument csproj, string suffix)
{
var import = csproj.SelectSingleNode ("/*/*/*[local-name() = 'None' and contains(@Include ,'Info.plist')]");
import.Attributes ["Include"].Value = import.Attributes ["Include"].Value.Replace("Info.plist", $"Info{suffix}.plist");
var logicalName = import.SelectSingleNode ("./*[local-name() = 'LogicalName']");
if (logicalName == null) {
logicalName = csproj.CreateElement ("LogicalName", MSBuild_Namespace);
import.AppendChild (logicalName);
if (import != null) {
import.Attributes ["Include"].Value = import.Attributes ["Include"].Value.Replace ("Info.plist", $"Info{suffix}.plist");
var logicalName = import.SelectSingleNode ("./*[local-name() = 'LogicalName']");
if (logicalName == null) {
logicalName = csproj.CreateElement ("LogicalName", MSBuild_Namespace);
import.AppendChild (logicalName);
}
logicalName.InnerText = "Info.plist";
}
logicalName.InnerText = "Info.plist";
}

public static string GetInfoPListInclude (this XmlDocument csproj)
Expand Down