Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[illink] Do not preserve A.R.Extensions #5365

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

radekdoulik
Copy link
Member

@radekdoulik radekdoulik commented Dec 3, 2020

Part of #5167

The type is not accessed through reflection.

It is preserved by the linker when needed like:

illinkanalyzer -r Android.Runtime.Extensions linker-dependencies.xml.gz
...
--- Method:TResult Android.Runtime.Extensions::JavaCast(Android.Runtime.IJavaObject) dependencies ---
Dependency #1
        Method:TResult Android.Runtime.Extensions::JavaCast(Android.Runtime.IJavaObject)
        | MethodSpec:TResult Android.Runtime.Extensions::JavaCast<T>(Android.Runtime.IJavaObject) [1 deps]
        | Method:T Android.App.Activity::FindViewById(System.Int32) [1 deps]
        | MethodSpec:!!0 Android.App.Activity::FindViewById<Android.Widget.Button>(System.Int32) [1 deps]
        | Method:System.Void UnnamedProject.MainActivity::OnCreate(Android.OS.Bundle) [2 deps]
        | Assembly:UnnamedProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [1 deps]
        | Other:Copy
...

Part of dotnet#5167

The type is not accessed through reflection.

It is preserved by the linker when needed like:

    --- Method:TResult Android.Runtime.Extensions::JavaCast(Android.Runtime.IJavaObject) dependencies ---
    Dependency dotnet#1
            Method:TResult Android.Runtime.Extensions::JavaCast(Android.Runtime.IJavaObject)
            | MethodSpec:TResult Android.Runtime.Extensions::JavaCast<T>(Android.Runtime.IJavaObject) [1 deps]
            | Method:T Android.App.Activity::FindViewById(System.Int32) [1 deps]
            | MethodSpec:!!0 Android.App.Activity::FindViewById<Android.Widget.Button>(System.Int32) [1 deps]
            | Method:System.Void UnnamedProject.MainActivity::OnCreate(Android.OS.Bundle) [2 deps]
            | Assembly:UnnamedProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [1 deps]
            | Other:Copy
@radekdoulik radekdoulik requested a review from jonpryor as a code owner December 3, 2020 14:59
@jonpryor
Copy link
Member

jonpryor commented Dec 3, 2020

Do we need to preserve Android.Runtime.Extensions in "legacy" Xamarin.Android as well? I'm not sure why we needed to preserve it in the first place, and xamarin/monodroid@11529d47e does not provide enlightenment.

@jonpryor
Copy link
Member

jonpryor commented Dec 3, 2020

what's the illinkanalyzer command that gave you the output provided in the PR message?

@jonpryor jonpryor merged commit f58b96d into dotnet:master Dec 4, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants