0.6.1
Pre-release
Pre-release
Koin Compiler Plugin 0.6.1
Release date: 2026-03-30
New Features
module<T>() and modules(vararg KClass) APIs
Load @Module classes without referencing generated code directly. The compiler plugin intercepts these calls and transforms them at compile time. (#14)
startKoin {
module<NetworkModule>()
modules(DataModule::class, CacheModule::class)
}Requires Koin 4.2.1-beta-1+
@ScopeId Parameter Support
Resolve dependencies from named Koin scopes. Generates getScope("id").get<T>(). Compile safety skips @ScopeId parameters. (#2)
@Factory
class ProfileService(@ScopeId(name = "user_session") val session: UserSession)
// Generates: ProfileService(scope.getScope("user_session").get())@Provided on Parameters
Previously only worked on classes. Now also works on individual constructor parameters to skip compile safety for that specific parameter. (#7)
@Singleton
class MyService(@Provided val ctx: PlatformContext)Scope Parameter Injection
Parameters of type org.koin.core.scope.Scope are automatically injected with the scope receiver. No annotation needed.
@Scoped
class ScopedService(val scope: Scope)
// Generates: ScopedService(scope)@Property/@PropertyValue Validation
Warns at compile time when @Property("key") has no matching @PropertyValue("key") default.
@PropertyValue("api.timeout")
val defaultTimeout = 30
@Factory
class ApiClient(@Property("api.timeout") val timeout: Int) // OK
@Factory
class Other(@Property("missing.key") val value: String) // WARNINGDSL Compile Safety Improvements
- Module reachability validation — Tracks which DSL modules are loaded via
modules()andincludes(). Reports compile errors for definitions in unreachable modules. bind()operator support — Explicitbind(Interface::class)is now tracked for DSL definitions. Auto-binding of supertypes removed for DSL path (matches Koin runtime behavior).create(::function)hints — Provider-only definitions fromcreate(::function)now generate cross-module hints withproviderOnlyflag.- Qualifier propagation in DSL hints —
@Named,@Qualifier, and type qualifiers are now encoded in DSL cross-module hints. - Call-site detection —
by inject()andby viewModel()property delegates in class bodies are now detected for A4 validation.
Bug Fixes
- Fix qualifier propagation in function definition calls
- Fix
@Monitortracing: warn if Kotzilla SDK library is missing - Fix DSL
bind()not being tracked — removingbindnow correctly triggers compile error - Fix
create(::function)not producing cross-module DSL hints - Fix FIR module data null for external library types (e.g., DataStore, CoroutineDispatcher)
- Fix cross-module qualifier encoding with dots in names
Breaking Changes
- DSL auto-binding removed — DSL definitions (
single<T>(),factory<T>()) no longer auto-bind to supertypes. Use explicitbind(Interface::class)to register secondary types. This matches Koin runtime behavior.
Compatibility
| Dependency | Version |
|---|---|
| Koin | 4.2.1-beta-1+ (for module<T>() API), 4.2.0-RC2+ (for other features) |
| Kotlin | 2.3.x+ (K2 compiler required) |