Hello, when using annotations with KMM - In the <d...
# koin
r
Hello, when using annotations with KMM - In the documentation:
Copy code
dependencies {
    add("kspCommonMainMetadata", libs.koin.ksp.compiler)
    add("kspAndroid", libs.koin.ksp.compiler)
    add("kspIosX64", libs.koin.ksp.compiler)
    add("kspIosArm64", libs.koin.ksp.compiler)
    add("kspIosSimulatorArm64", libs.koin.ksp.compiler)
}
But in the example on github:
Copy code
// DO NOT add bellow dependencies
//    add("kspAndroid", Deps.Koin.kspCompiler)
//    add("kspIosX64", Deps.Koin.kspCompiler)
//    add("kspIosArm64", Deps.Koin.kspCompiler)
//    add("kspIosSimulatorArm64", Deps.Koin.kspCompiler)
Does the documentation need an update?
👀 1
a
yes clearly need a refresh 👍
r
TBH I did not completely understand why we have commented that part? I can raise an MR once I have clarity on this
a
depends can be a reuse of an outdated project ... need to check 🤔
r
Edit: This works
Copy code
dependencies {
    add("kspCommonMainMetadata", libs.koin.ksp.compiler)
}

tasks.withType<KotlinCompilationTask<*>>().configureEach {
    if (name != "kspCommonMainKotlinMetadata") {
        dependsOn("kspCommonMainKotlinMetadata")
    }
}

afterEvaluate {
    tasks.filter {
        it.name.contains("SourcesJar", true)
    }.forEach {
        it.dependsOn("kspCommonMainKotlinMetadata")
    }
}
I had missed setting:
Copy code
commonMain.configure { kotlin.srcDirs("build/generated/ksp/metadata/commonMain/kotlin") }
Hey everyone, what is the right way to setup ksp? I tried both and I'm not able to reference
CommonModule().module
The module generation is successful
Copy code
public val io_github_rubenquadros_timetowish_CommonModule : Module get() = module {
	includes(io.github.rubenquadros.timetowish.core.di.TWCoreModule().module,io.github.rubenquadros.timetowish.shared.di.TWSharedModule().module)
}
public val io.github.rubenquadros.timetowish.CommonModule.module : org.koin.core.module.Module get() = io_github_rubenquadros_timetowish_CommonModule
👍 1
1