KSP documentation

Hello!

I saw next statement in the documentation:

It may also be necessary to configure these directories in your KSP consumer module's build script:

kotlin { 
    sourceSets.main {
         kotlin.srcDir("build/generated/ksp/main/kotlin") 
    }
    sourceSets.test { 
         kotlin.srcDir("build/generated/ksp/test/kotlin")
    } 
}

If you are using IntelliJ IDEA and KSP in a Gradle plugin then the above snippet will give the following warning:
Execution optimizations have been disabled for task ':publishPluginJar' to ensure correctness due to the following reasons: Gradle detected a problem with the following location: '../build/generated/ksp/main/kotlin'.
Reason: Task ':publishPluginJar' uses this output of task ':kspKotlin' without declaring an explicit or implicit dependency.

How this configuration relates to publishPluginJar?

Thanks

1 Like