I was actually able to separate my project into su...
# javascript
f
I was actually able to separate my project into submodules. Now I have one root parent project and two submodules app and kspcore with app being able to import functions and annotations from kspcore and it compiles. Only thing missing is for my kspcore to actually be able to use ksp, I have included the plugin but it seems to still be missing something in my build graddle to import ksp classes.
kspcore/build.gradle.kts
:
Copy code
plugins {
    alias(libs.plugins.kotlin.multiplatform)
    alias(libs.plugins.kotlinx.serialization)
    alias(libs.plugins.kotlinx.jsPlainObjects)
    id("org.jetbrains.kotlin.plugin.assignment")
    id("com.google.devtools.ksp")
}

group = "me.user"
version = "1.0-SNAPSHOT"

kotlin {
    js {
        browser()
        useEsModules()
        binaries.executable()

        compilerOptions {
            optIn.add("kotlin.js.ExperimentalJsExport")
        }
    }

    sourceSets {
        commonMain.dependencies {
            implementation(libs.kotlinx.serialization.json)
        }
        commonTest.dependencies {
            implementation(libs.kotlin.test)
        }
        jsMain.dependencies {
            implementation(libs.kotlinx.browser)
        }
    }
}
c
If you want to create your own symbol processor you don’t apply the plugins but use the api dependency. https://kotlinlang.org/docs/ksp-quickstart.html#create-a-processor-of-your-own
Applying the plugin is for consuming a symbol processor. See the first section on this page.
f
That makes sense, thank you.
I tried adding
implementation("com.google.devtools.ksp:symbol-processing-api:2.2.10-2.0.2")
to jsMain dependencies (and the others as well) but now I get kspcorecommonMain: Could not resolve com.google.devtools.ksp:symbol-processing-api
c
Not sure if KSP is able to work on a KMP JS module. You should ask in #ksp for reaching the right people.
f
I will thank you