Skip to content

Instantly share code, notes, and snippets.

@vladimirpetrovski
Last active June 11, 2020 19:10
Show Gist options
  • Select an option

  • Save vladimirpetrovski/724fbfefd78456b99955316fa796e567 to your computer and use it in GitHub Desktop.

Select an option

Save vladimirpetrovski/724fbfefd78456b99955316fa796e567 to your computer and use it in GitHub Desktop.
commonMain/build.gradle.kts Used in issue https://github.com/lamba92/firebase-multiplatform/issues/11
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
id("com.android.library")
}
android {
compileSdkVersion(29)
defaultConfig {
minSdkVersion(21)
targetSdkVersion(29)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
// By default the android gradle plugin expects to find the kotlin source files in
// the folder `main` and the test in the folder `test`. This is to be able place
// the source code files inside androidMain and androidTest folders
sourceSets {
val main by getting {
java.srcDirs("src/androidMain/kotlin")
manifest.srcFile("src/androidMain/AndroidManifest.xml")
res.srcDirs("src/androidMain/res")
}
val test by getting {
java.srcDirs("src/androidTest/kotlin")
res.srcDirs("src/androidTest/res")
}
}
}
kotlin {
android()
//Revert to just ios() when gradle plugin can properly resolve it
val onPhone = System.getenv("SDK_NAME")?.startsWith("iphoneos") ?: false
if (onPhone) {
iosArm64("ios")
} else {
iosX64("ios")
}
targets.getByName<KotlinNativeTarget>("ios").compilations["main"].kotlinOptions.freeCompilerArgs +=
listOf("-Xobjc-generics", "-Xg0")
version = "1.1"
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common", "1.3.71"))
implementation("org.koin:koin-core:3.0.0-alpha-2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.6")
implementation("com.github.lamba92:firebase-multiplatform-core:0.1.8")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by getting {
dependencies {
implementation(kotlin("stdlib", "1.3.71"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6")
}
}
val androidTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
}
}
val iosMain by getting {
dependencies {
}
}
val iosTest by getting {
dependencies {
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment