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

Multimodule scan for definitions #135

Merged
merged 2 commits into from
Jul 10, 2024
Merged

Conversation

arnaudgiuliani
Copy link
Member

@arnaudgiuliani arnaudgiuliani commented Jul 10, 2024

Generate definitions as external if not captured in a local module, to be scanned by an external module later.

Those external definitions are functions, that can be called in other modules. They are generated in Default file, where it can be imported via @Definition annotation.

Examples apps are updated with such use. Like:

package org.koin.sample.androidx.data

@Factory
class DataConsumer

will be scanned by in another Gradle module:

@ComponentScan("org.koin.sample.androidx.data")
class DataModule

Generated code in Default file, to be scanner by compiler:

@Definition("org.koin.sample.androidx.data")
fun Module.defineDataConsumer() = factory() { org.koin.sample.androidx.data.DataConsumer() } 

@arnaudgiuliani arnaudgiuliani added this to the 1.4.0 milestone Jul 10, 2024
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