https://kotlinlang.org logo
d

Daniele B

04/05/2021, 9:45 PM
Question about SqlDelight: I would like to place the database schema somewhere inside the “*commonMain/kotlin*” folder, rather than the “*commonMain/sqldelight*” folder. But I can’t find the way. Has anyone managed to do it?
b

Big Chungus

04/05/2021, 9:54 PM
Have you tried placing them in commonMain/resources?
c

Casey Brooks

04/05/2021, 10:01 PM
The Gradle plugin documentation shows a
sourceFolders
property, is that not working? https://cashapp.github.io/sqldelight/multiplatform_sqlite/gradle/
d

Daniele B

04/05/2021, 10:10 PM
@Casey Brooks
sourceFolders
defaults to the “sqldelight” folder. I can’t find a way to point it to the “commonMain/kotlin” folder
c

Casey Brooks

04/05/2021, 10:13 PM
Defaults to [“sqldelight”] (src/main/sqldelight)
Probably just unclear documentation, it should say “src/*commonMain*/sqldelight” in the MPP docs. It seems like you should be able to set
sourceFolders = ["kotlin"]
to reference
.sq
files in
src/commonMain/kotlin
d

Daniele B

04/05/2021, 10:18 PM
@Casey Brooks it worked indeed! thanks
👌 1
2 Views