Skip to content

Commit 60e42c0

Browse files
authored
Merge branch 'master' into auth-result
2 parents fad3664 + 0c6f408 commit 60e42c0

File tree

115 files changed

+767
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+767
-537
lines changed

.github/actions/setup_test_action/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
shell: bash
1919
run: npm update
2020
- name: Gradle cache
21-
uses: gradle/gradle-build-action@v2
21+
uses: gradle/actions/setup-gradle@v4
2222
- name: Grant execute permission for gradlew
2323
shell: bash
2424
run: chmod +x gradlew

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gradle"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
distribution: 'zulu'
2525
java-version: '17'
26-
- uses: gradle/gradle-build-action@v2
26+
- uses: gradle/actions/setup-gradle@v4
2727
- name: Setup versions
2828
run: ./gradlew :updateVersions
2929
- name: Grant execute permission for gradlew
@@ -65,7 +65,7 @@ jobs:
6565
with:
6666
distribution: 'zulu'
6767
java-version: '17'
68-
- uses: gradle/gradle-build-action@v2
68+
- uses: gradle/gradle-build-action@v3
6969
- name: Grant execute permission for gradlew
7070
run: chmod +x gradlew
7171
- name: Generate documentation

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: run apiCheck
2323
run: ./gradlew apiCheck
2424
jobMatrixSetup:
25-
runs-on: macos-latest
25+
runs-on: ubuntu-latest
2626
outputs:
2727
emulator_jobs_matrix: ${{ steps.dataStep.outputs.emulator_jobs_matrix }}
2828
ios_test_jobs_matrix: ${{ steps.dataStep.outputs.ios_test_jobs_matrix }}

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ The following libraries are available for the various Firebase products.
1616

1717
| Service or Product | Gradle Dependency | API Coverage |
1818
|---------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19-
| [Analytics](https://firebase.google.com/docs/analytics) | [`dev.gitlive:firebase-analytics:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-analytics/1.13.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) |
20-
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.13.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) |
21-
| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.13.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) |
22-
| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.13.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) |
23-
| [Cloud Functions](https://firebase.google.com/docs/functions) | [`dev.gitlive:firebase-functions:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.13.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) |
24-
| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.13.0/pom) | [![1%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-messaging/src/commonMain/kotlin/dev/gitlive/firebase/messaging/messaging.kt) |
25-
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.13.0/pom) | [![40%](https://img.shields.io/badge/-40%25-orange?style=flat-square)](/firebase-storage/src/commonMain/kotlin/dev/gitlive/firebase/storage/storage.kt) |
26-
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.13.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) |
27-
| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.13.0/pom) | [![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square)](/firebase-config/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt) |
28-
| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.13.0/pom) | [![1%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-perf/src/commonMain/kotlin/dev/gitlive/firebase/perf/performance.kt) |
29-
| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.13.0/pom) | [![80%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-crashlytics/src/commonMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt) |
19+
| [Analytics](https://firebase.google.com/docs/analytics) | [`dev.gitlive:firebase-analytics:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-analytics/2.0.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) |
20+
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/2.0.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) |
21+
| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/2.0.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) |
22+
| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/2.0.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) |
23+
| [Cloud Functions](https://firebase.google.com/docs/functions) | [`dev.gitlive:firebase-functions:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/2.0.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) |
24+
| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/2.0.0/pom) | [![1%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-messaging/src/commonMain/kotlin/dev/gitlive/firebase/messaging/messaging.kt) |
25+
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/2.0.0/pom) | [![40%](https://img.shields.io/badge/-40%25-orange?style=flat-square)](/firebase-storage/src/commonMain/kotlin/dev/gitlive/firebase/storage/storage.kt) |
26+
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/2.0.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) |
27+
| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/2.0.0/pom) | [![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square)](/firebase-config/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt) |
28+
| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/2.0.0/pom) | [![1%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-perf/src/commonMain/kotlin/dev/gitlive/firebase/perf/performance.kt) |
29+
| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/2.0.0/pom) | [![80%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-crashlytics/src/commonMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt) |
3030

3131
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)
3232

@@ -259,7 +259,7 @@ It uses the <a href="https://github.com/GitLiveApp/firebase-java-sdk">Firebase J
259259

260260
### Accessing the underlying Firebase SDK
261261

262-
In some cases you might want to access the underlying official Firebase SDK in platform specific code, for example when the common API is missing the functionality you need. For this purpose each class in the SDK has `android`, `ios` and `js` properties which holds the equivalent object of the underlying official Firebase SDK. For *JVM*, as the `firebase-java-sdk` is a direct port of the Firebase Android SDK, is it also accessed via the `android` property.
262+
In some cases you might want to access the underlying official Firebase SDK in platform specific code, for example when the common API is missing the functionality you need. For this purpose each class in the SDK has `android`, `ios` and `js` extension properties that hold the equivalent object of the underlying official Firebase SDK. For *JVM*, as the `firebase-java-sdk` is a direct port of the Firebase Android SDK, is it also accessed via the `android` property.
263263

264264
These properties are only accessible from the equivalent target's source set. For example to disable persistence in Cloud Firestore on Android you can write the following in your Android specific code (e.g. `androidMain` or `androidTest`):
265265

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ buildscript {
3030
}
3131

3232
val compileSdkVersion by extra(34)
33-
val minSdkVersion by extra(23)
33+
val targetSdkVersion by extra(34)
34+
val minSdkVersion by extra(21)
3435

3536
tasks {
3637
register("updateVersions") {

convention-plugin-test-option/src/main/kotlin/TestOptionsConfig.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import com.android.build.api.dsl.ManagedVirtualDevice
22
import com.android.build.api.dsl.TestOptions
3+
import org.gradle.api.Project
34
import org.gradle.kotlin.dsl.create
5+
import org.gradle.kotlin.dsl.provideDelegate
46

5-
fun TestOptions.configureTestOptions() {
7+
fun TestOptions.configureTestOptions(project: Project) {
8+
val targetSdkVersion: Int by project
9+
targetSdk = targetSdkVersion
610
unitTests {
711
isIncludeAndroidResources = true
812
all { test: org.gradle.api.tasks.testing.Test ->

firebase-analytics/api/android/firebase-analytics.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public final class dev/gitlive/firebase/analytics/AnalyticsKt {
1212

1313
public final class dev/gitlive/firebase/analytics/FirebaseAnalytics {
1414
public fun <init> (Lcom/google/firebase/analytics/FirebaseAnalytics;)V
15-
public final fun getAndroid ()Lcom/google/firebase/analytics/FirebaseAnalytics;
1615
public final fun getSessionId (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
1716
public final fun logEvent (Ljava/lang/String;Ljava/util/Map;)V
1817
public static synthetic fun logEvent$default (Ldev/gitlive/firebase/analytics/FirebaseAnalytics;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)V
@@ -207,5 +206,6 @@ public final class dev/gitlive/firebase/analytics/FirebaseAnalyticsUserProperty
207206
public final class dev/gitlive/firebase/analytics/analyticsAndroid {
208207
public static final fun analytics (Ldev/gitlive/firebase/Firebase;Ldev/gitlive/firebase/FirebaseApp;)Ldev/gitlive/firebase/analytics/FirebaseAnalytics;
209208
public static final fun getAnalytics (Ldev/gitlive/firebase/Firebase;)Ldev/gitlive/firebase/analytics/FirebaseAnalytics;
209+
public static final fun getAndroid (Ldev/gitlive/firebase/analytics/FirebaseAnalytics;)Lcom/google/firebase/analytics/FirebaseAnalytics;
210210
}
211211

firebase-analytics/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ android {
3333
targetCompatibility = JavaVersion.VERSION_17
3434
}
3535

36-
testOptions.configureTestOptions()
36+
testOptions.configureTestOptions(project)
3737
packaging {
3838
resources.pickFirsts.add("META-INF/kotlinx-serialization-core.kotlin_module")
3939
resources.pickFirsts.add("META-INF/AL2.0")
@@ -80,7 +80,7 @@ kotlin {
8080
iosX64()
8181
iosSimulatorArm64()
8282
cocoapods {
83-
ios.deploymentTarget = "12.0"
83+
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
8484
framework {
8585
baseName = "FirebaseAnalytics"
8686
}

firebase-analytics/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-analytics",
3-
"version": "1.13.0",
3+
"version": "2.0.0",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-analytics.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-app": "1.13.0",
26+
"@gitlive/firebase-app": "2.0.0",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.6.10",
2929
"kotlinx-coroutines-core": "1.6.1-native-mt"

firebase-analytics/src/androidMain/kotlin/dev/gitlive/firebase/analytics/analytics.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public actual val Firebase.analytics: FirebaseAnalytics
1616
public actual fun Firebase.analytics(app: FirebaseApp): FirebaseAnalytics =
1717
FirebaseAnalytics(com.google.firebase.Firebase.analytics)
1818

19-
public actual class FirebaseAnalytics(public val android: com.google.firebase.analytics.FirebaseAnalytics) {
19+
public val FirebaseAnalytics.android: com.google.firebase.analytics.FirebaseAnalytics get() = android
20+
21+
public actual class FirebaseAnalytics(internal val android: com.google.firebase.analytics.FirebaseAnalytics) {
2022
public actual fun logEvent(name: String, parameters: Map<String, Any>?) {
2123
android.logEvent(name, parameters?.toBundle())
2224
}

firebase-analytics/src/iosMain/kotlin/dev/gitlive/firebase/analytics/analytics.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ public actual val Firebase.analytics: FirebaseAnalytics
1515

1616
public actual fun Firebase.analytics(app: FirebaseApp): FirebaseAnalytics = FirebaseAnalytics(FIRAnalytics)
1717

18-
public actual class FirebaseAnalytics(public val ios: FIRAnalytics.Companion) {
18+
public val FirebaseAnalytics.ios: FIRAnalytics.Companion get() = ios
19+
20+
public actual class FirebaseAnalytics(internal val ios: FIRAnalytics.Companion) {
1921
public actual fun logEvent(name: String, parameters: Map<String, Any>?) {
2022
val mappedParameters: Map<Any?, Any>? = parameters?.map { it.key to it.value }?.toMap()
2123
ios.logEventWithName(name, mappedParameters)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import dev.gitlive.firebase.Firebase
44
import dev.gitlive.firebase.FirebaseApp
55
import dev.gitlive.firebase.FirebaseException
66
import dev.gitlive.firebase.analytics.externals.getAnalytics
7+
import dev.gitlive.firebase.js
78
import kotlinx.coroutines.await
89
import kotlin.time.Duration
910

@@ -13,7 +14,9 @@ public actual val Firebase.analytics: FirebaseAnalytics
1314
public actual fun Firebase.analytics(app: FirebaseApp): FirebaseAnalytics =
1415
FirebaseAnalytics(getAnalytics(app.js))
1516

16-
public actual class FirebaseAnalytics(public val js: dev.gitlive.firebase.analytics.externals.FirebaseAnalytics) {
17+
public val FirebaseAnalytics.js: dev.gitlive.firebase.analytics.externals.FirebaseAnalytics get() = js
18+
19+
public actual class FirebaseAnalytics(internal val js: dev.gitlive.firebase.analytics.externals.FirebaseAnalytics) {
1720
public actual fun logEvent(
1821
name: String,
1922
parameters: Map<String, Any>?,

firebase-app/api/android/firebase-app.api

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ public final class dev/gitlive/firebase/Firebase {
77
}
88

99
public final class dev/gitlive/firebase/FirebaseApp {
10-
public final fun component1 ()Lcom/google/firebase/FirebaseApp;
11-
public final fun copy (Lcom/google/firebase/FirebaseApp;)Ldev/gitlive/firebase/FirebaseApp;
12-
public static synthetic fun copy$default (Ldev/gitlive/firebase/FirebaseApp;Lcom/google/firebase/FirebaseApp;ILjava/lang/Object;)Ldev/gitlive/firebase/FirebaseApp;
1310
public final fun delete (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
1411
public fun equals (Ljava/lang/Object;)Z
15-
public final fun getAndroid ()Lcom/google/firebase/FirebaseApp;
1612
public final fun getName ()Ljava/lang/String;
1713
public final fun getOptions ()Ldev/gitlive/firebase/FirebaseOptions;
1814
public fun hashCode ()I
@@ -23,6 +19,7 @@ public final class dev/gitlive/firebase/FirebaseKt {
2319
public static final fun app (Ldev/gitlive/firebase/Firebase;Ljava/lang/String;)Ldev/gitlive/firebase/FirebaseApp;
2420
public static final fun apps (Ldev/gitlive/firebase/Firebase;Ljava/lang/Object;)Ljava/util/List;
2521
public static synthetic fun apps$default (Ldev/gitlive/firebase/Firebase;Ljava/lang/Object;ILjava/lang/Object;)Ljava/util/List;
22+
public static final fun getAndroid (Ldev/gitlive/firebase/FirebaseApp;)Lcom/google/firebase/FirebaseApp;
2623
public static final fun getApp (Ldev/gitlive/firebase/Firebase;)Ldev/gitlive/firebase/FirebaseApp;
2724
public static final fun initialize (Ldev/gitlive/firebase/Firebase;Ljava/lang/Object;)Ldev/gitlive/firebase/FirebaseApp;
2825
public static final fun initialize (Ldev/gitlive/firebase/Firebase;Ljava/lang/Object;Ldev/gitlive/firebase/FirebaseOptions;)Ldev/gitlive/firebase/FirebaseApp;

0 commit comments

Comments
 (0)