Dusan Stefanovic
12/02/2024, 5:40 PM@Qualifier
) when using R8, because code generation is done before obfuscation… is there any work around this except keeping the type un-obfuscated?
Also would it be possible to create module using DSL (module{ }
) and then include that module into module declared via annotation (@Module
)? I guess easy work around then would be to create module via DSL which contains definitions with qualifiers and include it back to module hierarchy defined with annotationsDusan Stefanovic
12/02/2024, 8:16 PM@Module
class MyModule
// Without @Module
class MyModuleExtension {
val module : org.koin.core.module.Module get() = module {
includes(MyModule().module)
// my definitions with qualifier<T>()
}
}
@Module(includes = [
//MyModule::class,
MyModuleExtension::class,
])
class AppModule
@arnaud.giuliani it would be nice to hear your opinion on this: is this “hack” acceptable or we maybe need a way to annotate function that provides dsl module definition to a module defined with annotations, similar way we can use @Single
etcarnaud.giuliani
12/06/2024, 6:36 PMarnaud.giuliani
12/06/2024, 6:37 PMHi, I have an issue with type qualifier annotation (ok, interesting. Not reported until now) when using R8, because code generation is done before obfuscation… is there any work around this except keeping the type un-obfuscated?@Qualifier
arnaud.giuliani
12/06/2024, 6:37 PMDusan Stefanovic
12/09/2024, 11:55 AM@Qualifier
is org.koin.core.qualifier.StringQualifier("com.example.MyClass")
instead of
qualifier<com.example.MyClass>()
and then since ksp runs before R8 we end up with unobfuscated string qualifier in generated code while when using injection at runtime we would probably do qualifier<MyClass>()
where MyClass
is now a obfuscated and generating a different qualifier (StringQualifier("a.b.C")
)Dusan Stefanovic
12/09/2024, 12:23 PM@Provided
is used to ignore compile time safety for a type, right? What I asked for is how to include dsl declared module into annotation declared module.
As far as I know we can include dsl module into dsl module, annotated module into annotated module, and annotated module into dsl module but I am not sure to include dsl module into annotated module, the example from above is a hack since it imitates koin code generation (generated property val module : org.koin.core.module.Module get()
) but if you change how the code generation work it will break probably