Closed Diy2210 closed 4 years ago
It looks like there is problem connecting SQLDelight in your build.gradle
file. The first problem is that the directory for the .sq
files is specified incorrectly inside block sqldelight
. Just put here only directory name:
ServerBase {
packageName = "org.example.mpp"
sourceFolders = ["sqldelight"]
}
And then you can add .sq
files into directory mpp-library/src/commonMain/kotlin/sqldelight/org/example/mpp
.
Tnx!
Hi, i try connect SQLDelight to my app using MOKO-Widgets-Template, but after generates Gradle - MyApp(root) - Tasks - sqldelight result: Task :mpp-library:generateAndroidDebugServerBaseInterface NO-SOURCE!!! How correct connect new library to MOKO? Or which SQL library to use MPP with MOKO-Widgets-Template?
build.gradle.kts plugins { id("com.android.library") id("org.jetbrains.kotlin.multiplatform") id("dev.icerock.mobile.multiplatform") id("dev.icerock.mobile.multiplatform-resources") id("com.squareup.sqldelight") }
sqldelight { database("ServerBase") { packageName = "org.example.mpp" sourceFolders = listOf("mpp-library/src/commonMain/kotlin/sqldelight") // schemaOutputDirectory = file("build/dbs") } // linkSqlite = false }
android { compileSdkVersion(Versions.Android.compileSdk)
}
val mppLibs = listOf( Deps.Libs.MultiPlatform.mokoResources, Deps.Libs.MultiPlatform.mokoWidgets, )
setupFramework( exports = mppLibs )
dependencies { mppLibrary(Deps.Libs.MultiPlatform.kotlinStdLib) mppLibrary(Deps.Libs.MultiPlatform.coroutines) mppLibrary(Deps.Libs.MultiPlatform.ktorClient) androidLibrary(Deps.Libs.Android.lifecycle) mppLibs.forEach { mppLibrary(it) } }
multiplatformResources { multiplatformResourcesPackage = "org.example.library" }