Imported Upstream version 6.12.0.122

Former-commit-id: d3ff4118f95cc6907059c6001e5157df8832a115
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2021-02-22 16:53:32 +00:00
parent bb7877ea56
commit a0d6f2d6ec
61 changed files with 896 additions and 752 deletions

View File

@@ -71,6 +71,7 @@ namespace Mono.Linker.Steps
void ProcessAssembly (AssemblyDefinition assembly, XPathNodeIterator iterator)
{
ProcessTypes (assembly, iterator.Current.SelectChildren ("type", ""));
ProcessResources (assembly, iterator.Current.SelectChildren ("resource", ""));
}
void ProcessTypes (AssemblyDefinition assembly, XPathNodeIterator iterator)
@@ -184,6 +185,21 @@ namespace Mono.Linker.Steps
}
}
void ProcessResources (AssemblyDefinition assembly, XPathNodeIterator iterator)
{
while (iterator.MoveNext ()) {
XPathNavigator nav = iterator.Current;
string name = GetAttribute (nav, "name");
if (String.IsNullOrEmpty (name)) {
Context.LogMessage (MessageImportance.High, $"Invalid value for 'name' attribute: '{name}'.");
return;
}
Context.Annotations.AddResourceToRemove (assembly, name);
}
}
static bool TryConvertValue (string value, TypeReference target, out object result)
{
switch (target.MetadataType) {