Describe the bug
In our case, we have several hundred (around 600) annotated classes in our gradle module. Using @ComponentScan() will produce single module with single lambda containing everything found. In our case, this lambda is not compilable for JVM as it is too large.
exception: exception: java.lang.RuntimeException: Error generating class file org/koin/ksp/generated/AppModuleGencom_thomaskKt.class (compiled from [/Users/thomask/Documents/KoinComponentScanTest/build/generated/ksp/main/kotlin/org/koin/ksp/generated/AppModuleGencom$thomask.kt]): Method too large: org/koin/ksp/generated/AppModuleGencom_thomaskKt.com_thomask_AppModule$lambda$600 (Lorg/koin/core/module/Module;)Lkotlin/Unit;
To Reproduce
Steps to reproduce the behavior:
Create 600 @Single annotated classes
Create app module with @ComponentScan() annotation
Describe the bug In our case, we have several hundred (around 600) annotated classes in our gradle module. Using
@ComponentScan()
will produce single module with single lambda containing everything found. In our case, this lambda is not compilable for JVM as it is too large.To Reproduce Steps to reproduce the behavior:
@Single
annotated classes@ComponentScan()
annotationExpected behavior Produced code is compilable to JVM even for large project with hundreds annotated classes found by single
@ComponentScan
Koin project used and used version (please complete the following information):
koin-core version 3.5.6
koin-annotations 1.3.1
koin-ksp-compiler 1.3.1