[TrimmableTypeMap][Core B] Foundation and AssemblyIndex#10817
[TrimmableTypeMap][Core B] Foundation and AssemblyIndex#10817simonrozsival wants to merge 3 commits intodotnet:dev/simonrozsival/ttm-core-a-foundationfrom
Conversation
src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/AssemblyIndex.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
| // [Export] methods are detected per-method in CollectMarshalMethods | |
| // [Export] methods are not handled yet and supporting them wil be implemented later |
There was a problem hiding this comment.
| return parentName + "+" + name; | |
| return $"{parentName}+{name}"; |
There was a problem hiding this comment.
| return ns + "." + name; | |
| return $"{ns}.{name}"; |
There was a problem hiding this comment.
I don't really know if this information would be useful later, but it would be useful in tests I think: let's remember the exact type of the attribute please. I think it might be best to make this class abstract and add a sealed subclass for each of the component classes. The ApplicationBackupAgent and ApplicationManageSpaceActivity fields should be just on the ApplicationAttributeInfo class (without the redundant Application prefix).
There was a problem hiding this comment.
Does typeDef.GetInterfaceImplementations () return only the interfaces implemented on this type level, or also the inherited interfaces? I would expect this API not to recursively explore the interfaces implemented on the base class and the base interfaces of the implemented interfaces. I think we should either not do this yet (we would only support the predefined set of attributes such as [Register], [Application], [Activity], ..., or do it properly and recursively explore the structure. This could be very expensive, so we'd need to carefuly cache if a given type (class or interface) implements IJniNameProviderAttribute. The more I'm thinking about it, the more I think we should not even look for this interface. We can add this logic once we run into a scenario that actually requires it.
There was a problem hiding this comment.
| if (attrInfo != null) { | |
| if (attrInfo is not null) { |
|
Addressed all review feedback in this and downstream stacked PRs: applied null patterns ( |
9822cf0 to
2f303ed
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2f303ed to
4921d7d
Compare
- Remove IJniNameProviderAttribute discovery and ReclassifyAttributes; only support hardcoded known component attributes for now - Remove JniNameProviderAttributeInfo (unused without dynamic discovery) - Convert RegisterInfo and ExportInfo to records with required init - Use .IsNullOrEmpty() extension method instead of string.IsNullOrEmpty() - Add NullableExtensions.cs for netstandard2.0 nullable-aware string checks - Throw on unknown component attribute name instead of silently creating a JniNameProviderAttributeInfo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4730fdf to
a2ac436
Compare
Sliced from #10805
Depends on #10816
Scope
project, model/providers)AssemblyIndexmetadata indexing and lookup logicNotes