https://kotlinlang.org logo
Title
l

leandro

03/09/2023, 11:12 AM
We have KSP in our project and to have its generated files be picked up by Android tasks, we had to declare on our build.gradle inside `android{}`:
sourceSets {
    debug.java.srcDirs += 'build/generated/ksp/debug/kotlin'
    release.java.srcDirs += 'build/generated/ksp/release/kotlin'
    testDebug.java.srcDirs += 'build/generated/ksp/debugUnitTest/kotlin'
    androidTestDebug.java.srcDirs += 'build/generated/ksp/debugAndroidTest/kotlin'
  }
This was added while we were using Kotlin 1.7.x... on our tests using Kotlin 1.8.10, this doesnt seem to be necessary anymore, and I am trying to confirm if this was fixed? Thanks
g

glureau

03/09/2023, 11:26 AM
I think this trick was for the IDE to be aware. If the doc is right, it's still required for IDE, and maybe your IDE works because of some IDE cached files? Have you tried to invalidate your IDE cache and/or remove the .idea and then reload your project to see if it's still alright for IDE without the sourceSets trick?
l

leandro

03/09/2023, 11:43 AM
Hey glureau, I did indeed invalidate the caches and removed my .idea directory, and things just work now. You're right that it could be the idea, i know it was not working on Dolphin, but on EE and Giraffe things seem to be fine
j

Jiaxiang

03/09/2023, 6:49 PM
Actually, the doc is outdated and we should update it, since latest KSP 1.0.9, it should be already included for IDE to index.
l

leandro

03/09/2023, 9:17 PM
Amazing, thanks for the confirmation!