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

Module can't generate ModuleGen file on specific case. #14

Closed
aerain opened this issue Apr 16, 2022 · 1 comment
Closed

Module can't generate ModuleGen file on specific case. #14

aerain opened this issue Apr 16, 2022 · 1 comment
Labels
status:checking Ticket is currently being checked type:issue Something isn't working
Milestone

Comments

@aerain
Copy link

aerain commented Apr 16, 2022

Describe the bug
When I declare same named two Module class in different packages,
koin-ksp-compiler failed to task.

To Reproduce
Steps to reproduce the behavior:

  1. declare two Module class in different packages with same name.

foo/DatabaseConfig.kt

package foo

@Module
class DatabaseConfig {

    @Single
    @Named("mysql")
    fun mysql(): String = "this is mysql"
}

bar/DatabaseConfig.kt

package bar

@Module
class DatabaseConfig {
    @Single
    @Named("mariadb")
    fun mariadb(): String = "this is mariadb"
}
  1. build
  2. kspKotlin task failed.
  3. See error
[ksp] kotlin.io.FileAlreadyExistsException: [location]
        at com.google.devtools.ksp.processing.impl.CodeGeneratorImpl.createNewFile(CodeGeneratorImpl.kt:75)
	at com.google.devtools.ksp.processing.CodeGenerator$DefaultImpls.createNewFile$default(CodeGenerator.kt:59)
	at org.koin.compiler.generator.KoinGeneratorKt.getFile(KoinGenerator.kt:103)
	at org.koin.compiler.generator.KoinGeneratorKt.getFile$default(KoinGenerator.kt:103)
	at org.koin.compiler.generator.KoinGenerator.generateModule(KoinGenerator.kt:68)
	at org.koin.compiler.generator.KoinGenerator.generateModules(KoinGenerator.kt:49)
        ...

Expected behavior
Generate Two Module files successfully.

Koin project used and used version (please complete the following information):
koin-core: 3.2.0-beta-1
koin-annotations: 1.0.0-beta-2

Additional moduleDefinition
Add any other moduleDefinition about the problem here.

@arnaudgiuliani arnaudgiuliani added type:issue Something isn't working status:checking Ticket is currently being checked labels May 4, 2022
@arnaudgiuliani arnaudgiuliani added this to the 1.0.0 milestone May 4, 2022
@arnaudgiuliani
Copy link
Member

To follow with #15

arnaudgiuliani added a commit that referenced this issue Jun 8, 2022
clean up code #1 - module list scan

fix quickstart & sandbox

clean up code

fix includes

avoid useless bindings of Any & ViewModel
alperenbabagil pushed a commit to alperenbabagil/koin-annotations that referenced this issue Oct 15, 2022
alperenbabagil pushed a commit to alperenbabagil/koin-annotations that referenced this issue Oct 15, 2022
InsertKoinIO#14

clean up code InsertKoinIO#1 - module list scan

fix quickstart & sandbox

clean up code

fix includes

avoid useless bindings of Any & ViewModel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:checking Ticket is currently being checked type:issue Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants