Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.
This repository was archived by the owner on May 4, 2022. It is now read-only.

@Export should support "onlyIn" parameter #238

@smaugho

Description

@smaugho

The @export annotation should permit to specify in which classes it should Export the method. For instance, commonly some methods are intended to be used only in an activity, but the class itself can be used in many different classes (Fragments, ViewModels), for instance:

    @Export
    @RunWith("onActivityResult")
    public void facebookLoginOnActivityResult(int requestCode, int resultCode, Intent data) {
        if (callbackManager != null) {
            callbackManager.onActivityResult(requestCode, resultCode, data);
        }
    }

Currently, if you inject a class which has this into another class (ie: a ViewModel), it will try to export the "facebookLoginOnActivityResult" method there (even if it is not used). This causes unnecessary grow of the generated code.

It would be good to have something like:

@Export(onlyIn={Activity.class, SomeOther.class})
...

So, it will export the method only for the given classes or its subclasses.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions