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 the explicit API mode when generating Dagger factories #145

Merged
merged 3 commits into from
Oct 26, 2020

Conversation

marcellogalhardo
Copy link
Contributor

@marcellogalhardo marcellogalhardo commented Oct 18, 2020

Anvil uses KotlinPoet to generate the Dagger factories in which in the latest version 1.7.0: "Generated code is now compatible with the explicit API mode by default.".

This PR:

  • Updates KotlinPoet to 1.7.2, as it is required due to the error: Cannot use KotlinPoet version 1.7.0 with Java 8.
  • Updates the sample app to use explicit API mode in the :sample:scopes and :sample:library modules to show its usage, :sample:app module is untouched as it is not a "library" module. If this is not necessary, I can revert the commit.

Fixes #144.

@marcellogalhardo
Copy link
Contributor Author

Updated the PR to use KotlinPoet 1.7.2.

Copy link
Collaborator

@vRallev vRallev left a comment

Choose a reason for hiding this comment

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

I'm so sorry for the delay. This PR is great. Could I ask you to enable the explicit API mode in the :integration-tests:* module rather than the sample? The sample is supposed to be closer to the real world and many projects won't enable the explicit API mode. On the other side, that's exactly the purpose of the integration tests.

@marcellogalhardo marcellogalhardo force-pushed the main branch 2 times, most recently from 98e459e to 0207aa1 Compare October 26, 2020 07:23
@marcellogalhardo
Copy link
Contributor Author

marcellogalhardo commented Oct 26, 2020

Hey @vRallev - no worries, I understand. I dropped the changes on :sample and converted all modules from :integration_tests to Explicit API Mode as you requested. Thanks for the review and let me know if I miss something!

@vRallev vRallev merged commit 26525cb into square:main Oct 26, 2020
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.

Support the explicit API mode when generating Dagger factories
2 participants