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

support inheritance across modules. Issue #808. #1045

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stephanenicolas
Copy link
Contributor

@stephanenicolas stephanenicolas commented Aug 4, 2017

This PR:

  • fixes issue Generated ViewBinding doesn't extend from library module ViewBinding #808. The BK AP can use a super class that was already compiled in a different module. It checks for the view binder of such classes, and looks at some extra properties of the binder to ensure the subclasses are generated correctly (whether they need a context to bind views or not).
  • add a simple inheritance unit test. It uses a base class that is precompiled to simulate that the super class of a class under test could already have been compiled in a different module.
  • changes the sample (here, I am wondering how you guys do to change the sample before releasing..)

We would appreciate your feedback on this PR about both the idea of the solution and its implementation, tests, etc.

@stephanenicolas stephanenicolas force-pushed the sni/support-inheritance-in-modules branch from 308ffdd to 664f760 Compare August 25, 2017 15:55
@stephanenicolas stephanenicolas changed the title support inheritance in modules support inheritance across modules Aug 26, 2017
@stephanenicolas stephanenicolas changed the title support inheritance across modules support inheritance across modules. Solves issue #808. Aug 26, 2017
@stephanenicolas stephanenicolas changed the title support inheritance across modules. Solves issue #808. support inheritance across modules. <br> Solves issue #808. Aug 26, 2017
@stephanenicolas stephanenicolas changed the title support inheritance across modules. <br> Solves issue #808. support inheritance across modules. Issue #808. Aug 26, 2017
@JakeWharton JakeWharton added this to the 9.0.0 milestone Oct 10, 2017
@tongngocdat
Copy link

shopquannamdangcap

@@ -367,6 +369,12 @@
bindingMap.put(type, builder.build());
} else {
BindingSet parentBinding = bindingMap.get(parentType);

// parent binding is null, let's try to find a previouly generated binding
Copy link

Choose a reason for hiding this comment

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

Typo in comment -> "previouly"

BindingSet.Builder parentBuilder = BindingSet.newBuilder(parentType);
if (hasViewBindings(parentType)) {
//add a fake field to the parent class so that it will indicate it has a view bindings.
//this is required for the subclass to generate a proper view binder
Copy link

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants