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

Allow extendability (plugin support?) #192

Open
dshatz opened this issue Nov 27, 2024 · 3 comments
Open

Allow extendability (plugin support?) #192

dshatz opened this issue Nov 27, 2024 · 3 comments

Comments

@dshatz
Copy link

dshatz commented Nov 27, 2024

Is your feature request related to a problem? Please describe.
I am developing a ksp processor for generating a koin module from ktorfit declarations.
https://github.com/dshatz/ktorfit-koin

The user creates a class:

@ServiceModule(scan="com.example.services")
class NetworkModule

My library generates:

val NetworkModule.module: Module = networkModule
val networkModule = module {
   // all ktorfit services discovered by my ksp processor.
}

Then, import the generated module into a normal Koin module.

@Module(includes=[NetworkModule::class])
class AppModule

The problem is that koin config check doesn't allow this. The error I get is:
Fix your configuration: add @Module annotation on <Module class generated by ktorfit-koin>

Describe the solution you'd like
Optionally disable @Module annotation presence check (for generated code?). Or implement some plugin mechanism?

Describe alternatives you've considered
Disabling koin config check.

Target Koin project
Koin annotations, to be specific config check part.

@dshatz
Copy link
Author

dshatz commented Nov 30, 2024

I have resolved this (see latest commit in the repo above).

@arnaudgiuliani
Copy link
Member

can you give ref of your commit?

@dshatz
Copy link
Author

dshatz commented Jan 16, 2025

can you give ref of your commit?

d6234843906423fcbf0ecd924f5de6564770e1d3

Check the part with markerName.
Basically I manually generate an empty class for each ktorfit-koin module so that koin config check doesn't complain about missing @module annotation on those.

Not sure if that is relevant to koin-annotations anymore.
But could you explain please what's the purpose behind those generated empty classes (they end with Def from what I remember)?

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

No branches or pull requests

2 participants