Skip to content

Commit

Permalink
[Java.Interop.Tools.JavaCallableWrappers] JavaTypeScanner.GetJavaTypes (
Browse files Browse the repository at this point in the history
#1076)

Context: dotnet/android#7694

Add an overload of `JavaTypeScanner.GetJavaTypes()` that takes in a
`Mono.Cecil.AssemblyDefinition`.  This is more easily used by linker
steps.
  • Loading branch information
jonathanpeppers authored Jan 18, 2023
1 parent f03088e commit bde306d
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ public List<TypeDefinition> GetJavaTypes (IEnumerable<string> assemblies, IAssem
return javaTypes;
}

public List<TypeDefinition> GetJavaTypes (AssemblyDefinition assembly)
{
var javaTypes = new List<TypeDefinition> ();

foreach (ModuleDefinition md in assembly.Modules) {
foreach (TypeDefinition td in md.Types) {
AddJavaTypes (javaTypes, td);
}
}

return javaTypes;
}

void AddJavaTypes (List<TypeDefinition> javaTypes, TypeDefinition type)
{
if (type.IsSubclassOf ("Java.Lang.Object", cache) ||
Expand Down

0 comments on commit bde306d

Please sign in to comment.