https://kotlinlang.org logo
#gradle
Title
# gradle
e

edwinRNDR

11/02/2023, 8:10 AM
After upgrading to Kotlin 1.9.20 I noticed it is no longer possible to have
commonMain
depend on source sets. I have a task that generates Kotlin files in a secondary source set which is compiled as common Kotlin. Prior to 1.9.20 that worked like https://github.com/openrndr/openrndr/blob/master/openrndr-filter/build.gradle.kts but I have no idea how to set this up in 1.9.20.
m

mbonnin

11/02/2023, 1:06 PM
Add your generated directory to the
commonMain
source set:
Copy code
kotlin.sourceSets.getByName("commonMain").kotlin.srcDir("path/to/generated/dir")
e

edwinRNDR

11/02/2023, 1:18 PM
ok, so the entire idea of having the generated code in a separate sourceset should be abandoned?
m

mbonnin

11/02/2023, 1:18 PM
Looks like it
e

edwinRNDR

11/02/2023, 2:11 PM
this works for me, thanks @mbonnin
👍 1
👍🏾 1