Skip to content

Commit e9d8666

Browse files
committed
Added firestore support
1 parent 44577db commit e9d8666

File tree

4 files changed

+452
-0
lines changed

4 files changed

+452
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ local.properties
88
firebase-app/src/iosMain/c_interop/modules/
99
firebase-functions/src/iosMain/c_interop/modules/
1010
firebase-auth/src/iosMain/c_interop/modules/
11+
firebase-firestore/src/iosMain/c_interop/modules/

firebase-firestore/build.gradle.kts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
33
plugins {
44
id("com.android.library")
55
kotlin("multiplatform")
6+
kotlin("native.cocoapods")
67
`maven-publish`
78
}
89

@@ -42,6 +43,14 @@ kotlin {
4243
}
4344
}
4445

46+
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
47+
kotlinOptions.freeCompilerArgs += listOf(
48+
"-Xuse-experimental=kotlin.Experimental",
49+
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
50+
"-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer"
51+
)
52+
}
53+
4554
sourceSets {
4655
val commonMain by getting {
4756
dependencies {
@@ -58,6 +67,8 @@ kotlin {
5867
}
5968
val iosMain by creating {
6069
dependencies {
70+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.14.0")
71+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.3")
6172
}
6273
}
6374
val jvmMain by getting {
@@ -71,6 +82,22 @@ kotlin {
7182
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:0.14.0")
7283
}
7384
}
85+
86+
configure(listOf(iosArm64, iosX64)) {
87+
compilations.getByName("main") {
88+
source(sourceSets.get("iosMain"))
89+
val firebasefirestore by cinterops.creating {
90+
packageName("cocoapods.FirebaseFirestore")
91+
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseFirestore.def"))
92+
compilerOpts("-F$projectDir/src/iosMain/c_interop/modules/FirebaseFirestore-6.17.0")
93+
}
94+
}
95+
}
96+
97+
cocoapods {
98+
summary = ""
99+
homepage = ""
100+
}
74101
}
75102
}
76103

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language = Objective-C
2+
modules = FirebaseFirestore
3+
compilerOpts = -framework FirebaseFirestore
4+
linkerOpts = -framework FirebaseFirestore

0 commit comments

Comments
 (0)