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

FR: Module -> Module contribution #15

Closed
ZacSweers opened this issue Jun 25, 2020 · 2 comments
Closed

FR: Module -> Module contribution #15

ZacSweers opened this issue Jun 25, 2020 · 2 comments

Comments

@ZacSweers
Copy link
Collaborator

ZacSweers commented Jun 25, 2020

A common case I've run into is wanting to have modules contribute to other modules, rather than components. I often use modules that are intentionally reusable, and generating a module that contributes to them would be immensely helpful.

@Module
class DataModule { .. }

@Module
@ContributesTo(DataModule::class)
class VariantDataModule { .. }

// Results in 
@Module(includes = [VariantDataModule::class])
class DataModule { .. }
@ZacSweers ZacSweers changed the title FR: Module merging FR: Module -> Module contribution Jun 25, 2020
@vRallev
Copy link
Collaborator

vRallev commented Jun 25, 2020

There is an annotation for this @MergeModules and @MergeInterfaces. Does this solve your use case?

@MergeModules(AppScope::class)
abstract class AppModule

This annotation will generate the annotation @dagger.Module.

@ZacSweers
Copy link
Collaborator Author

Looks like it! Will dig and re-open if need be

IlyaGulya pushed a commit to IlyaGulya/anvil that referenced this issue Jul 25, 2024
* Check for dagger creator annotations in KSP

Resolves square#15

* Don't run on windows
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

No branches or pull requests

2 participants