From a92106b3696fdc47e155a8b869013d3a3161fb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Owodzin=CC=81?= Date: Wed, 3 Nov 2021 00:13:24 +0000 Subject: [PATCH] updated Firebase SDKs, fixed one missing -ktx dependency --- build.gradle.kts | 4 ++-- firebase-app/package.json | 2 +- firebase-app/src/nativeInterop/cinterop/Cartfile | 2 +- firebase-auth/package.json | 2 +- .../jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt | 4 ++-- firebase-auth/src/nativeInterop/cinterop/Cartfile | 2 +- firebase-common/build.gradle.kts | 2 +- firebase-common/package.json | 2 +- .../jsMain/kotlin/dev/gitlive/firebase/externals.kt | 3 +-- .../jsMain/kotlin/dev/gitlive/firebase/externals2.kt | 10 +++++----- firebase-config/build.gradle.kts | 2 +- firebase-config/package.json | 2 +- .../dev/gitlive/firebase/remoteconfig/RemoteConfig.kt | 2 ++ .../firebase/remoteconfig/FirebaseRemoteConfig.kt | 4 ++-- firebase-config/src/nativeInterop/cinterop/Cartfile | 2 +- firebase-database/package.json | 2 +- firebase-database/src/nativeInterop/cinterop/Cartfile | 2 +- firebase-firestore/package.json | 2 +- firebase-firestore/src/nativeInterop/cinterop/Cartfile | 2 +- firebase-functions/package.json | 2 +- firebase-functions/src/nativeInterop/cinterop/Cartfile | 2 +- 21 files changed, 29 insertions(+), 28 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e512e1f2a..63d3f09d7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,7 @@ buildscript { } } dependencies { - classpath("com.android.tools.build:gradle:7.0.1") + classpath("com.android.tools.build:gradle:7.0.3") classpath("com.adarshr:gradle-test-logger-plugin:2.1.1") } } @@ -197,7 +197,7 @@ subprojects { dependencies { "commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") "androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.5.2") - "androidMainImplementation"(platform("com.google.firebase:firebase-bom:28.4.1")) + "androidMainImplementation"(platform("com.google.firebase:firebase-bom:29.0.0")) "commonTestImplementation"(kotlin("test-common")) "commonTestImplementation"(kotlin("test-annotations-common")) "commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") diff --git a/firebase-app/package.json b/firebase-app/package.json index b04ec1a26..9b852f91c 100644 --- a/firebase-app/package.json +++ b/firebase-app/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-common": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-app/src/nativeInterop/cinterop/Cartfile b/firebase-app/src/nativeInterop/cinterop/Cartfile index 8d78efb90..8d7d98311 100644 --- a/firebase-app/src/nativeInterop/cinterop/Cartfile +++ b/firebase-app/src/nativeInterop/cinterop/Cartfile @@ -1 +1 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 8.8.0 +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 8.9.1 diff --git a/firebase-auth/package.json b/firebase-auth/package.json index e2668ff1f..9c71c23d8 100644 --- a/firebase-auth/package.json +++ b/firebase-auth/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt b/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt index 340f1fa6c..0323cd3b6 100644 --- a/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt +++ b/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt @@ -15,8 +15,8 @@ actual fun runTest(test: suspend () -> Unit) = GlobalScope .promise { try { test() - } catch (e: dynamic) { - (e as? Throwable)?.log() + } catch (e: Throwable) { + e.log() throw e } }.asDynamic() diff --git a/firebase-auth/src/nativeInterop/cinterop/Cartfile b/firebase-auth/src/nativeInterop/cinterop/Cartfile index c9d68bb30..cd89fe4b6 100644 --- a/firebase-auth/src/nativeInterop/cinterop/Cartfile +++ b/firebase-auth/src/nativeInterop/cinterop/Cartfile @@ -1 +1 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 8.8.0 +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 8.9.1 diff --git a/firebase-common/build.gradle.kts b/firebase-common/build.gradle.kts index ba4c667cf..2496f3c15 100644 --- a/firebase-common/build.gradle.kts +++ b/firebase-common/build.gradle.kts @@ -108,7 +108,7 @@ kotlin { val jsMain by getting { dependencies { - api(npm("firebase", "8.7.1")) + api(npm("firebase", "9.4.1")) } } } diff --git a/firebase-common/package.json b/firebase-common/package.json index 96cfb72d1..306f5de28 100644 --- a/firebase-common/package.json +++ b/firebase-common/package.json @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-multiplatform-sdk", "dependencies": { - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2", "kotlinx-serialization-kotlinx-serialization-runtime": "1.3.0" diff --git a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt index 3485345b0..73e18750d 100644 --- a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt +++ b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt @@ -2,8 +2,7 @@ * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ -@file:JsModule("firebase/app") - +@file:JsModule("firebase/compat/app") package dev.gitlive.firebase import kotlin.js.Json diff --git a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt index fbc2409a8..212d099ea 100644 --- a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt +++ b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt @@ -6,19 +6,19 @@ package dev.gitlive.firebase import kotlin.js.Promise -@JsModule("firebase/functions") +@JsModule("firebase/compat/functions") external object functions -@JsModule("firebase/auth") +@JsModule("firebase/compat/auth") external object auth -@JsModule("firebase/database") +@JsModule("firebase/compat/database") external object database -@JsModule("firebase/firestore") +@JsModule("firebase/compat/firestore") external object firestore -@JsModule("firebase/remote-config") +@JsModule("firebase/compat/remote-config") external object remoteConfig typealias SnapshotCallback = (data: firebase.database.DataSnapshot, b: String?) -> Unit diff --git a/firebase-config/build.gradle.kts b/firebase-config/build.gradle.kts index 6af6ec0ea..6b9ab1d37 100644 --- a/firebase-config/build.gradle.kts +++ b/firebase-config/build.gradle.kts @@ -143,7 +143,7 @@ kotlin { val androidMain by getting { dependencies { - api("com.google.firebase:firebase-config") + api("com.google.firebase:firebase-config-ktx") } } diff --git a/firebase-config/package.json b/firebase-config/package.json index a1a774ef7..389ebaa56 100644 --- a/firebase-config/package.json +++ b/firebase-config/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt b/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt index d7de3c9ed..54d5f0675 100644 --- a/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt +++ b/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt @@ -8,6 +8,8 @@ package dev.gitlive.firebase.remoteconfig import androidx.test.platform.app.InstrumentationRegistry import kotlinx.coroutines.runBlocking +actual val emulatorHost: String = "10.0.2.2" + actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext actual fun runTest(test: suspend () -> Unit) = runBlocking { test() } diff --git a/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt b/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt index 676ad19b9..b73a4a0a2 100644 --- a/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt +++ b/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt @@ -9,8 +9,8 @@ actual fun runTest(test: suspend () -> Unit) = GlobalScope .promise { try { test() - } catch (e: dynamic) { - (e as? Throwable)?.log() + } catch (e: Throwable) { + e.log() throw e } }.asDynamic() diff --git a/firebase-config/src/nativeInterop/cinterop/Cartfile b/firebase-config/src/nativeInterop/cinterop/Cartfile index a944bdb12..031cc8495 100644 --- a/firebase-config/src/nativeInterop/cinterop/Cartfile +++ b/firebase-config/src/nativeInterop/cinterop/Cartfile @@ -1 +1 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" == 8.8.0 +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" == 8.9.1 diff --git a/firebase-database/package.json b/firebase-database/package.json index a18360057..e93312c26 100644 --- a/firebase-database/package.json +++ b/firebase-database/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-database/src/nativeInterop/cinterop/Cartfile b/firebase-database/src/nativeInterop/cinterop/Cartfile index 48e590b2d..47d3f6e64 100644 --- a/firebase-database/src/nativeInterop/cinterop/Cartfile +++ b/firebase-database/src/nativeInterop/cinterop/Cartfile @@ -1 +1 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDatabaseBinary.json" == 8.8.0 +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDatabaseBinary.json" == 8.9.1 diff --git a/firebase-firestore/package.json b/firebase-firestore/package.json index 4583702a3..d3df2f1c3 100644 --- a/firebase-firestore/package.json +++ b/firebase-firestore/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-firestore/src/nativeInterop/cinterop/Cartfile b/firebase-firestore/src/nativeInterop/cinterop/Cartfile index d8580d2e9..3db33c26e 100644 --- a/firebase-firestore/src/nativeInterop/cinterop/Cartfile +++ b/firebase-firestore/src/nativeInterop/cinterop/Cartfile @@ -1 +1 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json" == 8.8.0 +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json" == 8.9.1 diff --git a/firebase-functions/package.json b/firebase-functions/package.json index a5ec276fb..ff55e2ba7 100644 --- a/firebase-functions/package.json +++ b/firebase-functions/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-functions/src/nativeInterop/cinterop/Cartfile b/firebase-functions/src/nativeInterop/cinterop/Cartfile index 04b616b81..c03a8d5ed 100644 --- a/firebase-functions/src/nativeInterop/cinterop/Cartfile +++ b/firebase-functions/src/nativeInterop/cinterop/Cartfile @@ -1 +1 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFunctionsBinary.json" == 8.8.0 +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFunctionsBinary.json" == 8.9.1