Skip to content

Commit ed32136

Browse files
authored
Merge branch 'master' into kotlin-1-5
2 parents 942348e + d45afa7 commit ed32136

File tree

28 files changed

+194
-65
lines changed

28 files changed

+194
-65
lines changed

.github/workflows/pull_request.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
run: ./gradlew assemble
3131
- name: Run JS Tests
3232
run: ./gradlew cleanTest jsTest
33+
- name: Upload test artifact
34+
uses: actions/upload-artifact@v2
35+
if: failure()
36+
with:
37+
name: "JSTest Report HTML"
38+
path: "firebase-firestore/build/reports/tests/jsTest/"
3339
- name: Run Android Instrumented Tests
3440
uses: reactivecircus/android-emulator-runner@v2
3541
with:

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
<i>Real-time code collaboration inside any IDE</i><br/>
55
<br/>
66
<br/>
7-
The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar to the [Firebase Android SDK Kotlin Extensions](https://firebase.github.io/firebase-android-sdk/reference/kotlin/firebase-ktx/) but also supports multiplatform projects, enabling you to use Firebase directly from your common source targeting *iOS*, *Android* or *JS*.
7+
The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar to the <a href="https://firebase.github.io/firebase-android-sdk/reference/kotlin/firebase-ktx/">Firebase Android SDK Kotlin Extensions</a> but also supports multiplatform projects, enabling you to use Firebase directly from your common source targeting <strong>iOS</strong>, <strong>Android</strong> or <strong>JS</strong>.
88

99
## Available libraries
1010

1111
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.2.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.2.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.2.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.2.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.2.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.2.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.2.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.2.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.2.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.2.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.2.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.2.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
15+
| [Authentication](https://firebase.google.com/docs/auth#kotlin-android) | [`dev.gitlive:firebase-auth:1.3.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.3.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.3.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.3.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.3.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.3.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.3.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.3.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.3.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.3.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.3.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.3.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
2121

2222
Is the Firebase library or API you need missing? [Create an issue](https://github.com/GitLiveApp/firebase-kotlin-sdk/issues/new?labels=API+coverage&template=increase-api-coverage.md&title=Add+%5Bclass+name%5D.%5Bfunction+name%5D+to+%5Blibrary+name%5D+for+%5Bplatform+names%5D) to request additional API coverage or be awesome and [submit a PR](https://github.com/GitLiveApp/firebase-kotlin-sdk/fork)
2323

@@ -163,12 +163,12 @@ If you are building a Kotlin multiplatform library which will be consumed from J
163163

164164
```json
165165
"dependencies": {
166-
"@gitlive/firebase-auth": "1.2.0",
167-
"@gitlive/firebase-database": "1.2.0",
168-
"@gitlive/firebase-firestore": "1.2.0",
169-
"@gitlive/firebase-functions": "1.2.0",
170-
"@gitlive/firebase-storage": "1.2.0",
171-
"@gitlive/firebase-messaging": "1.2.0"
166+
"@gitlive/firebase-auth": "1.3.0",
167+
"@gitlive/firebase-database": "1.3.0",
168+
"@gitlive/firebase-firestore": "1.3.0",
169+
"@gitlive/firebase-functions": "1.3.0",
170+
"@gitlive/firebase-storage": "1.3.0",
171+
"@gitlive/firebase-messaging": "1.3.0"
172172
}
173173
```
174174

build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ subprojects {
6767
onlyIf { !project.gradle.startParameter.taskNames.contains("publishToMavenLocal") }
6868
}
6969

70+
tasks.whenTaskAdded {
71+
enabled = when(name) {
72+
"compileDebugUnitTestKotlinAndroid" -> false
73+
"compileReleaseUnitTestKotlinAndroid" -> false
74+
"testDebugUnitTest" -> false
75+
"testReleaseUnitTest" -> false
76+
else -> enabled
77+
}
78+
}
79+
7080
tasks {
7181

7282
val updateVersion by registering(Exec::class) {

firebase-app/build.gradle.kts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,20 @@ kotlin {
7777

7878
js {
7979
useCommonJs()
80-
nodejs()
81-
browser()
80+
nodejs {
81+
testTask {
82+
useMocha {
83+
timeout = "5s"
84+
}
85+
}
86+
}
87+
browser {
88+
testTask {
89+
useMocha {
90+
timeout = "5s"
91+
}
92+
}
93+
}
8294
}
8395

8496
sourceSets {

firebase-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-common": "1.2.0",
27-
"firebase": "8.4.3",
26+
"@gitlive/firebase-common": "1.3.0",
27+
"firebase": "8.5.0",
2828
"kotlin": "1.5.0",
2929
"kotlinx-coroutines-core": "1.5.0-RC"
3030
}

firebase-app/src/commonMain/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ data class FirebaseOptions(
5050
val gaTrackingId: String? = null,
5151
val storageBucket: String? = null,
5252
val projectId: String? = null,
53-
val gcmSenderId: String? = null
53+
val gcmSenderId: String? = null,
54+
val authDomain: String? = null
5455
)
5556

5657
expect open class FirebaseException : Exception

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class FirebaseAppTest {
1717
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
1818
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
1919
storageBucket = "fir-kotlin-sdk.appspot.com",
20-
projectId = "fir-kotlin-sdk"
20+
projectId = "fir-kotlin-sdk",
21+
gcmSenderId = "846484016111"
2122
)
2223
)
2324
}

firebase-app/src/jsMain/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ actual class FirebaseApp internal constructor(val js: firebase.App) {
2626
get() = js.name
2727
actual val options: FirebaseOptions
2828
get() = js.options.run {
29-
FirebaseOptions(applicationId, apiKey, databaseUrl, gaTrackingId, storageBucket, projectId)
29+
FirebaseOptions(applicationId, apiKey, databaseUrl, gaTrackingId, storageBucket, projectId, messagingSenderId, authDomain)
3030
}
3131
}
3232

@@ -39,7 +39,8 @@ private fun FirebaseOptions.toJson() = json(
3939
"storageBucket" to (storageBucket ?: undefined),
4040
"projectId" to (projectId ?: undefined),
4141
"gaTrackingId" to (gaTrackingId ?: undefined),
42-
"messagingSenderId" to (gcmSenderId ?: undefined)
42+
"messagingSenderId" to (gcmSenderId ?: undefined),
43+
"authDomain" to (authDomain ?: undefined)
4344
)
4445

4546
actual open class FirebaseException(code: String?, cause: Throwable) : Exception("$code: ${cause.message}", cause)

firebase-auth/build.gradle.kts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,20 @@ kotlin {
102102

103103
js {
104104
useCommonJs()
105-
nodejs()
106-
browser()
105+
nodejs {
106+
testTask {
107+
useMocha {
108+
timeout = "5s"
109+
}
110+
}
111+
}
112+
browser {
113+
testTask {
114+
useMocha {
115+
timeout = "5s"
116+
}
117+
}
118+
}
107119
}
108120

109121
sourceSets {

firebase-auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-app": "1.2.0",
27-
"firebase": "8.4.3",
26+
"@gitlive/firebase-app": "1.3.0",
27+
"firebase": "8.5.0",
2828
"kotlin": "1.5.0",
2929
"kotlinx-coroutines-core": "1.5.0-RC"
3030
}

0 commit comments

Comments
 (0)