Skip to content

Commit 0bde8c6

Browse files
Merge branch 'master' into add-start-and-end-query-cursors
2 parents 38e9fd1 + a135597 commit 0bde8c6

File tree

3 files changed

+56
-10
lines changed

3 files changed

+56
-10
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ jobs:
8585
uses: eskatos/gradle-command-action@v1
8686
with:
8787
arguments: :firebase-functions:publish
88+
env:
89+
sonatypeUsername: ${{ secrets.SONATYPEUSERNAME }}
90+
sonatypePassword: ${{ secrets.SONATYPEPASSWORD }}
91+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
92+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PASSPHRASE }}
93+
- name: Publish Firebase Installations
94+
uses: eskatos/gradle-command-action@v1
95+
with:
96+
arguments: :firebase-installations:publish
8897
env:
8998
sonatypeUsername: ${{ secrets.SONATYPEUSERNAME }}
9099
sonatypePassword: ${{ secrets.SONATYPEPASSWORD }}

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ The following libraries are available for the various Firebase products.
1212

1313
| Service or Product | Gradle Dependency | API Coverage |
1414
| ------------------------------------------------------------------------------------ | :-----------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15-
| [Authentication](https://firebase.google.com/docs/auth#kotlin-android) | [`dev.gitlive:firebase-auth:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.5.0/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/auth.kt) |
16-
| [Realtime Database](https://firebase.google.com/docs/database#kotlin-android) | [`dev.gitlive:firebase-database:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.5.0/pom) | [![70%](https://img.shields.io/badge/-70%25-orange?style=flat-square)](/firebase-database/src/commonMain/kotlin/dev/gitlive/firebase/database/database.kt) |
17-
| [Cloud Firestore](https://firebase.google.com/docs/firestore#kotlin-android) | [`dev.gitlive:firebase-firestore:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.5.0/pom) | [![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square)](/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt) |
18-
| [Cloud Functions](https://firebase.google.com/docs/functions/callable#kotlin-android)| [`dev.gitlive:firebase-functions:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.5.0/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-functions/src/commonMain/kotlin/dev/gitlive/firebase/functions/functions.kt) |
19-
| [Cloud Messaging](https://firebase.google.com/docs/messaging#kotlin-android) | [`dev.gitlive:firebase-messaging:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.5.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
20-
| [Cloud Storage](https://firebase.google.com/docs/storage#kotlin-android) | [`dev.gitlive:firebase-storage:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.5.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
21-
| [Remote Config](https://firebase.google.com/docs/remote-config/get-started?platform=android) | [`dev.gitlive:firebase-config:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.5.0/pom) | ![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square) |
15+
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.5.0/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/auth.kt) |
16+
| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.5.0/pom) | [![70%](https://img.shields.io/badge/-70%25-orange?style=flat-square)](/firebase-database/src/commonMain/kotlin/dev/gitlive/firebase/database/database.kt) |
17+
| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.5.0/pom) | [![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square)](/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt) |
18+
| [Cloud Functions](https://firebase.google.com/docs/functions)| [`dev.gitlive:firebase-functions:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.5.0/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-functions/src/commonMain/kotlin/dev/gitlive/firebase/functions/functions.kt) |
19+
| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.5.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
20+
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.5.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
21+
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.5.0/pom) | [![90%](https://img.shields.io/badge/-90%25-green?style=flat-square)](/firebase-installations/src/commonMain/kotlin/dev/gitlive/firebase/installations/installations.kt) |
22+
| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:1.5.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.5.0/pom) | ![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square) |
2223

2324

2425

@@ -200,12 +201,13 @@ If you are building a Kotlin multiplatform library which will be consumed from J
200201
```json
201202
"dependencies": {
202203
"@gitlive/firebase-auth": "1.5.0",
204+
"@gitlive/firebase-config": "1.5.0",
203205
"@gitlive/firebase-database": "1.5.0",
204206
"@gitlive/firebase-firestore": "1.5.0",
205207
"@gitlive/firebase-functions": "1.5.0",
206-
"@gitlive/firebase-storage": "1.5.0",
208+
"@gitlive/firebase-installations": "1.5.0",
207209
"@gitlive/firebase-messaging": "1.5.0",
208-
"@gitlive/firebase-config": "1.5.0"
210+
"@gitlive/firebase-storage": "1.5.0"
209211
}
210212
```
211213

firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ expect fun runTest(test: suspend CoroutineScope.() -> Unit)
3131
class FirebaseFirestoreTest {
3232

3333
@Serializable
34-
data class FirestoreTest(val prop1: String, val time: Double = 0.0, val count: Int = 0)
34+
data class FirestoreTest(
35+
val prop1: String,
36+
val time: Double = 0.0,
37+
val count: Int = 0,
38+
val list: List<String> = emptyList(),
39+
)
3540

3641
@BeforeTest
3742
fun initializeFirebase() {
@@ -391,6 +396,36 @@ class FirebaseFirestoreTest {
391396
assertEquals(5, dataAfter.count)
392397
}
393398

399+
@Test
400+
fun testArrayUnion() = runTest {
401+
val doc = Firebase.firestore
402+
.collection("testFirestoreArrayUnion")
403+
.document("test1")
404+
405+
doc.set(FirestoreTest.serializer(), FirestoreTest("increment1", list = listOf("first")))
406+
val dataBefore = doc.get().data(FirestoreTest.serializer())
407+
assertEquals(listOf("first"), dataBefore.list)
408+
409+
doc.update("list" to FieldValue.arrayUnion("second"))
410+
val dataAfter = doc.get().data(FirestoreTest.serializer())
411+
assertEquals(listOf("first", "second"), dataAfter.list)
412+
}
413+
414+
@Test
415+
fun testArrayRemove() = runTest {
416+
val doc = Firebase.firestore
417+
.collection("testFirestoreArrayRemove")
418+
.document("test1")
419+
420+
doc.set(FirestoreTest.serializer(), FirestoreTest("increment1", list = listOf("first", "second")))
421+
val dataBefore = doc.get().data(FirestoreTest.serializer())
422+
assertEquals(listOf("first", "second"), dataBefore.list)
423+
424+
doc.update("list" to FieldValue.arrayRemove("second"))
425+
val dataAfter = doc.get().data(FirestoreTest.serializer())
426+
assertEquals(listOf("first"), dataAfter.list)
427+
}
428+
394429
private suspend fun setupFirestoreData() {
395430
Firebase.firestore.collection("testFirestoreQuerying")
396431
.document("one")

0 commit comments

Comments
 (0)