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

Generate Dagger modules for @ContributesBinding with basic configuration #1112

Draft
wants to merge 1 commit into
base: main-k2
Choose a base branch
from

Conversation

JoelWilcox
Copy link
Member

This is a minimal FIR impl that handles generating the associated Dagger module with @ContributesTo and @module annotations, as well as the expected @BINDS method. Support for other configurations like ignoring qualifiers and replacing contributions will come as followup incremental changes.

import org.jetbrains.kotlin.name.Name

@OptIn(ExperimentalTopLevelDeclarationsGenerationApi::class)
public class BindingModuleData(
Copy link
Member Author

Choose a reason for hiding this comment

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

I kept the structure here mostly in-line with the POC branch until we can discuss concerns/alternatives (related https://github.com/square/anvil/pull/1110/files#r1951710072), and also because I'd like us to get the merging impl + related integration tests in before doing any heavier refactoring.

This is a minimal FIR impl that handles generating the associated Dagger module with @ContributesTo and @module annotations, as well as the expected @BINDS method. Support for other configurations like ignoring qualifiers and replacing contributions will come as followup incremental changes.
@JoelWilcox JoelWilcox force-pushed the joel/contributes-binding-min-generation branch from aa7725d to f1ff407 Compare February 12, 2025 02:13
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.

1 participant