Matteo Wohlrapp
01/18/2021, 8:47 AMplugins {
`kotlin-dsl`
}
repositories {
jcenter()
}
Top level:
buildscript {
val kotlin_version = "1.4.21"
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.1")
classpath("co.touchlab:kotlinnativecocoapods:0.12")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("com.google.gms:google-services:4.3.4")
}
}
allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven(url = "<https://kotlin.bintray.com/kotlinx>")
maven(url = "<https://github.com/square/sqldelight#gradle>")
maven(url = "<https://oss.sonatype.org/content/repositories/snapshots/>")
maven(url = "<https://dl.bintray.com/touchlabpublic/kotlin>")
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
Shared, part concerning ios:
plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
id("com.android.library")
kotlin("plugin.serialization") version "1.4.10"
id("com.squareup.sqldelight") version "1.4.3"
}
group = "com.example.[...]"
version = "1.0-SNAPSHOT"
kotlin {
android()
ios()
cocoapods {
// Configure fields required by CocoaPods.
summary = "[...]"
homepage = "No link provided."
// You can change the name of the produced framework.
// By default, it is the name of the Gradle project.
frameworkName = "shared"
ios.deploymentTarget = "13.0"
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.koin:koin-core:3.0.1-alpha-2")
implementation("com.russhwolf:multiplatform-settings:0.6.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9-mt")
implementation("io.ktor:ktor-client-core:1.4.1")
implementation("io.ktor:ktor-client-serialization:1.4.1")
implementation("co.touchlab:stately-common:1.1.0")
implementation("com.squareup.sqldelight:runtime:1.4.3")
}
}
val commonTest by getting
val androidMain by getting {
dependencies {
implementation("com.google.android.material:material:1.2.0")
implementation("io.ktor:ktor-client-android:1.4.1")
implementation("com.squareup.sqldelight:android-driver:1.4.3")
}
}
val androidTest by getting
val iosX64Main by getting {
kotlin.srcDir("iosMain")
dependencies {
implementation("org.koin:koin-core:3.0.1-alpha-2")
implementation("io.ktor:ktor-client-ios:1.4.1")
implementation("com.squareup.sqldelight:native-driver:1.4.3")
}
}
val iosArm64Main by getting {
kotlin.srcDir("iosMain")
dependencies {
implementation("org.koin:koin-core:3.0.1-alpha-2")
implementation("io.ktor:ktor-client-ios:1.4.1")
implementation("com.squareup.sqldelight:native-driver:1.4.3")
}
}
val iosTest by getting
}
}
android {
compileSdkVersion(29)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(24)
targetSdkVersion(29)
versionCode = 1
versionName = "1.0"
multiDexEnabled = true
}
}
sqldelight {
database("[...]") {
packageName = "database"
sourceFolders = listOf("sqldelight")
}
}