Skip to content

Commit e709c94

Browse files
[TrimmableTypeMap] JavaPeerScanner execution logic
Add JavaPeerScanner — the second phase that consumes AssemblyIndex results and produces the final list of JavaPeerInfo for the app: - Walks all indexed types and resolves their Java peer registrations - Handles inheritance: traverses base types across assemblies to find the nearest registered Java peer ancestor - Detects activation constructors (IntPtr+JniHandleOwnership) and distinguishes between direct declarations and inherited ones - Collects marshal methods ([Register] on methods) and exported methods ([Export]) with their JNI signatures - Merges component attribute metadata ([Activity], etc.) and resolves JNI names from attribute properties - Flags types for unconditional preservation when component attributes with non-default JNI names are present The scanner is designed as a pure function: assemblies in → peer info out, with no side effects or global state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 850f838 commit e709c94

File tree

2 files changed

+737
-7
lines changed

2 files changed

+737
-7
lines changed

src/Microsoft.Android.Sdk.TrimmableTypeMap/CompilerFeaturePolyfills.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ static class IsExternalInit { }
99
sealed class RequiredMemberAttribute : Attribute { }
1010

1111
[AttributeUsage (AttributeTargets.All, AllowMultiple = true, Inherited = false)]
12-
sealed class CompilerFeatureRequiredAttribute : Attribute
12+
sealed class CompilerFeatureRequiredAttribute (string featureName) : Attribute
1313
{
14-
public CompilerFeatureRequiredAttribute (string featureName)
15-
{
16-
FeatureName = featureName;
17-
}
18-
19-
public string FeatureName { get; }
14+
public string FeatureName { get; } = featureName;
2015
public bool IsOptional { get; init; }
2116
}
2217
}

0 commit comments

Comments
 (0)