```mport org.jetbrains.kotlin.gradle.plugin.mpp.Ko...
# multiplatform
h
Copy code
mport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
    kotlin("multiplatform")
    kotlin("plugin.serialization") version "1.5.0"
    id("com.android.library")
    id("com.squareup.sqldelight")
}
repositories {
    google()
    mavenCentral()
}

kotlin {
    android()

    val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
        if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
            ::iosArm64
        else
            ::iosX64

    iosTarget("ios") {
        binaries {
            framework {
                baseName = "shared"
            }
        }
    }

    sourceSets {

        val ktorVersion = "1.5.4"

        val commonMain by getting {
            dependencies {
//                implementation("com.facebook.android:facebook-android-sdk:[5,6)")
//                implementation("com.google.android.material:material:1.3.0")
//                implementation("com.google.firebase:firebase-messaging:10.2.1")
//                implementation("com.google.android.gms:play-services:10.2.1")
//                implementation("com.google.android.gms:play-services-ads:10.2.1")
//                implementation("com.google.firebase:firebase-core:10.2.1")
//                implementation("com.google.firebase:firebase-auth:10.2.1")
//                implementation("com.github.siyamed:android-shape-imageview:0.9.+@aar")
//                implementation("com.github.barteksc:android-pdf-viewer:3.1.0-beta.1")
//                implementation("org.apache.commons:commons-io:1.3.2")

                  // Logger
                  implementation("com.github.aakira:napier:1.4.1")

                  implementation("io.ktor:ktor-client-core:$ktorVersion")
                  implementation("io.ktor:ktor-client-serialization:$ktorVersion")
                  implementation("io.ktor:ktor-client-logging:$ktorVersion")

                  implementation("com.squareup.sqldelight:runtime:1.5.0")

//                implementation("com.google.android.material:material:1.3.0")
//                implementation("androidx.appcompat:appcompat:1.2.0")
//                implementation("androidx.legacy:legacy-support-v13:1.0.0")
//                implementation("androidx.core:core:1.0.0")
//                implementation("androidx.legacy:legacy-support-v4:1.0.0")
//                implementation("androidx.constraintlayout:constraintlayout:1.1.3")
//                implementation("com.android.support.constraint:constraint-layout:")
//                implementation("com.google.firebase:firebase-messaging:10.2.1")
//                implementation("com.google.android.gms:play-services:10.2.1")
//                implementation("com.google.android.gms:play-services-ads:10.2.1")
//                implementation("com.google.firebase:firebase-core:10.2.1")
//                implementation("com.google.firebase:firebase-auth:10.2.1")
//                implementation("com.github.siyamed:android-shape-imageview:0.9.+@aar")
//                implementation("com.facebook.android:facebook-android-sdk:[5,6)")
//                implementation("androidx.mediarouter:mediarouter:1.0.0")
//                implementation("androidx.vectordrawable:vectordrawable:1.0.0")
//                implementation("com.github.barteksc:android-pdf-viewer:3.1.0-beta.1")
//                implementation("org.apache.commons:commons-io:1.3.2")
//                implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.30")
            }
        }

        val commonTest by getting {
            dependencies {
                implementation(kotlin("test-common"))
                implementation(kotlin("test-annotations-common"))
            }
        }
        val androidMain by getting {
            dependencies {

                implementation("com.squareup.sqldelight:android-driver:1.5.0")

                implementation("io.ktor:ktor-client-okhttp:$ktorVersion")

                implementation("androidx.multidex:multidex:2.0.0")
                implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
                implementation(files("libs/ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar"))
                implementation(files("libs/pinchzoom.jar"))
                implementation(files("libs/org.apache.commons.net_2.0.0.v200905272248.jar"))
                implementation(files("libs/StartAppInApp-3.4.2.jar"))
                implementation(files("libs/picasso-2.5.2.jar"))
                implementation("com.google.android.material:material:1.3.0")
                implementation("androidx.appcompat:appcompat:1.2.0")
                implementation("androidx.appcompat:appcompat:1.0.0")
                implementation("androidx.legacy:legacy-support-v13:1.0.0")
                implementation("androidx.core:core:1.0.0")
                implementation("androidx.legacy:legacy-support-v4:1.0.0")
                implementation("androidx.constraintlayout:constraintlayout:1.1.3")
                implementation("com.android.support.constraint:constraint-layout:")
                implementation("com.google.firebase:firebase-messaging:10.2.1")
                implementation("com.google.android.gms:play-services:10.2.1")
                implementation("com.google.android.gms:play-services-ads:10.2.1")
                implementation("com.google.firebase:firebase-core:10.2.1")
                implementation("com.google.firebase:firebase-auth:10.2.1")
                implementation("com.github.siyamed:android-shape-imageview:0.9.+@aar")
                implementation("com.facebook.android:facebook-android-sdk:[5,6)")
                implementation("androidx.mediarouter:mediarouter:1.0.0")
                implementation("androidx.vectordrawable:vectordrawable:1.0.0")
                implementation("com.github.barteksc:android-pdf-viewer:3.1.0-beta.1")
                implementation("org.apache.commons:commons-io:1.3.2")
                implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.30")

            }
        }
        val androidTest by getting {
            dependencies {

                implementation(kotlin("test-junit"))
                implementation("junit:junit:4.13.2")
            }
        }
        val iosMain by getting {
            dependencies {
                implementation("io.ktor:ktor-client-ios:$ktorVersion")
                implementation("com.squareup.sqldelight:native-driver:1.5.0")
            }
        }
        val iosTest by getting

    }
}

apply { plugin("com.google.gms.google-services") }

android {
    compileSdkVersion(30)
    sourceSets["main"].manifest.srcFile("src//androidMain//AndroidManifest.xml")

    defaultConfig {
        minSdkVersion(17)
        targetSdkVersion(30)
    }

}

val packForXcode by tasks.creating(Sync::class) {
    val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
    val framework = kotlin.targets.getByName<KotlinNativeTarget>("ios").binaries.getFramework(mode)
    val targetDir = File(buildDir, "xcode-frameworks")

    group = "build"
    dependsOn(framework.linkTask)
    inputs.property("mode", mode)

    from({ framework.outputDirectory })
    into(targetDir)
}

tasks.getByName("build").dependsOn(packForXcode)

//dependencies {
//    implementation(files("/Users/mbp/AndroidStudioProjects/PashtoLibrary/androidApp/libs/ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar"))
//    implementation(files("/Users/mbp/AndroidStudioProjects/PashtoLibrary/androidApp/libs/org.apache.commons.net_2.0.0.v200905272248.jar"))
//    implementation(files("/Users/mbp/AndroidStudioProjects/PashtoLibrary/androidApp/libs/picasso-2.5.2.jar"))
//    implementation(files("/Users/mbp/AndroidStudioProjects/PashtoLibrary/androidApp/libs/pinchzoom.jar"))
//    implementation(files("/Users/mbp/AndroidStudioProjects/PashtoLibrary/androidApp/libs/StartAppInApp-3.4.2.jar"))
//}


sqldelight {
    database("LibraryApp"){
        packageName = "com.example.app.core.database"
        sourceFolders = listOf("db")
        dialect="sqlite:3.24"
    }
}
🧵 1
k
not creating MyDataBase.sq file inside commonMain folder
To clarify, you've created
MyDataBase.sq
and you don't see the generated Kotlin code?
h
i have not created MyDataBase.sq file in commonMain. I just thinks that after adding dependency and plugin at time of build it auto creates this file?
k
The sq files are written by you. Those drive generation of Kotlin. Where would `MyDataBase.sq`get generated from?