Skip to content

Allow migration to continue when symbols are bad - #98

Merged
mattleibow merged 2 commits into
masterfrom
dev/fix-symbols
May 4, 2020
Merged

mattleibow merged 2 commits into
masterfrom
dev/fix-symbols

Conversation

@mattleibow

Copy link
Copy Markdown
Member

Allow migration to continue when symbols are bad.

Fixes #38
Fixes #8
Fixes #79
Fixes #93

{
var types = def.MainModule.GetTypeReferences();
Assert.Empty(types.Where(t =>
(t.FullName.StartsWith("Android.Support.") || t.FullName.StartsWith("Android.Arch.")) &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case someone adds Material. Do we need to add it in the condition?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Not the best of tests...

Let me extract this logic into a function that can be reused. I'll keep it manual for more control for now.

// just ignore all symbols, there is nothing that can be done about bad symbols
readerParams.ReadSymbols = false;
return AssemblyDefinition.ReadAssembly(path, readerParams);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks the same we've been using: https://github.com/xamarin/java.interop/blob/377c4c7ab50d1f25082c7079214b8075eb25de35/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs#L144-L172

We use this DirectoryAssemblyResolver any time we use Mono.Cecil during Xamarin.Android's build.

@mattleibow
mattleibow merged commit e32d28e into master May 4, 2020
@mattleibow
mattleibow deleted the dev/fix-symbols branch May 4, 2020 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants