Skip to content

Commit

Permalink
Merge remote-tracking branch 'GitLiveApp/master' into feature/gitlive…
Browse files Browse the repository at this point in the history
…-master-tracking
  • Loading branch information
Daeda88 committed Aug 29, 2024
2 parents 64073d4 + a1c9f57 commit b0b7c53
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,3 @@ More recently, with the official SDK for Android providing better support for Ko
For contributors this means following these points when adding new code to the public API of this project:
- **Match the [Android SDKs API](https://firebase.google.com/docs/reference/kotlin/packages).** When adding new API coverage use the Android SDK as the guide on what the public API should be in regard to naming, parameters etc. The goal here is *near binary compatibility*, meaning code consuming the Android SDK compiles *as is* with the Kotlin SDK after just changing the package imports from `com.google` to `dev.gitlive`.
- **Follow our [Kotlin-first design](https://github.com/GitLiveApp/firebase-kotlin-sdk/?tab=readme-ov-file#kotlin-first-design) principles when needed.** If the API you are adding coverage for is new, and it's Kotlin-first in the Android SDK, then you can simply just match the Android SDKs API as described in the first point, but if it's an older Java-first API then ideally we would include an identical API for API compatibility *plus* a Kotlin-first overload. A good example for this is where the Builder pattern is employed in the Android SDK, here we can follow [this Kotlin-first design principle](https://github.com/GitLiveApp/firebase-kotlin-sdk/?tab=readme-ov-file#default-arguments) and provide both methods, one taking the options created with the builder and an overload with default arguments to avoid the builder boilerplate for developers not porting an existing android code base.

2 changes: 1 addition & 1 deletion firebase-auth/api/android/firebase-auth.api
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public final class dev/gitlive/firebase/auth/AuthTokenResult {
}

public final class dev/gitlive/firebase/auth/CredentialsKt {
public static final fun getAndroid (Lcom/google/firebase/auth/OAuthProvider;)Lcom/google/firebase/auth/OAuthProvider;
public static final fun getAndroid (Ldev/gitlive/firebase/auth/OAuthProvider;)Lcom/google/firebase/auth/OAuthProvider;
}

public final class dev/gitlive/firebase/auth/EmailAuthProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package dev.gitlive.firebase.auth

import android.app.Activity
import com.google.firebase.FirebaseException
import com.google.firebase.auth.OAuthProvider
import com.google.firebase.auth.OAuthProvider as AndroidOAuthProvider
import com.google.firebase.auth.PhoneAuthOptions
import com.google.firebase.auth.PhoneAuthProvider
import kotlinx.coroutines.CompletableDeferred
Expand Down Expand Up @@ -52,17 +52,17 @@ public actual object GoogleAuthProvider {
}
}

public val OAuthProvider.android: OAuthProvider get() = android
public val OAuthProvider.android: AndroidOAuthProvider get() = android

public actual class OAuthProvider(internal val android: OAuthProvider) {
public actual class OAuthProvider(internal val android: AndroidOAuthProvider) {

public actual constructor(
provider: String,
scopes: List<String>,
customParameters: Map<String, String>,
auth: FirebaseAuth,
) : this(
OAuthProvider
AndroidOAuthProvider
.newBuilder(provider, auth.android)
.setScopes(scopes)
.addCustomParameters(customParameters)
Expand All @@ -71,7 +71,7 @@ public actual class OAuthProvider(internal val android: OAuthProvider) {

public actual companion object {
public actual fun credential(providerId: String, accessToken: String?, idToken: String?, rawNonce: String?): OAuthCredential {
val builder = OAuthProvider.newCredentialBuilder(providerId)
val builder = AndroidOAuthProvider.newCredentialBuilder(providerId)
accessToken?.let { builder.setAccessToken(it) }
idToken?.let { builder.setIdToken(it) }
rawNonce?.let { builder.setIdTokenWithRawNonce(idToken!!, it) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package dev.gitlive.firebase.firestore.internal

import com.google.firebase.firestore.FirebaseFirestore
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Executor

// Since on iOS Callback threads are set as settings, we store the settings explicitly here as well
internal val callbackExecutorMap = ConcurrentHashMap<FirebaseFirestore, Executor>()
internal val callbackExecutorMap = ConcurrentHashMap<com.google.firebase.firestore.FirebaseFirestore, Executor>()
6 changes: 5 additions & 1 deletion firebase-perf/api/android/firebase-perf.api
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ public final class dev/gitlive/firebase/perf/metrics/Trace {
public final fun updateSession (Ldev/gitlive/firebase/perf/session/PerfSession;)V
}

public final class dev/gitlive/firebase/perf/metrics/TraceKt {
public static final fun getAndroid (Ldev/gitlive/firebase/perf/metrics/Trace;)Lcom/google/firebase/perf/metrics/Trace;
}

public final class dev/gitlive/firebase/perf/session/PerfSession {
}

public final class dev/gitlive/firebase/perf/session/PerfSessionKt {
public static final fun getAndroid (Lcom/google/firebase/perf/session/PerfSession;)Lcom/google/firebase/perf/session/PerfSession;
public static final fun getAndroid (Ldev/gitlive/firebase/perf/session/PerfSession;)Lcom/google/firebase/perf/session/PerfSession;
}

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package dev.gitlive.firebase.perf.metrics

import com.google.firebase.perf.metrics.Trace
import com.google.firebase.perf.metrics.Trace as AndroidTrace
import dev.gitlive.firebase.perf.session.PerfSession

public actual class Trace internal constructor(private val android: Trace) {
public val Trace.android: AndroidTrace get() = android

public actual class Trace internal constructor(internal val android: AndroidTrace) {

public actual fun start() {
android.start()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.gitlive.firebase.perf

import com.google.firebase.FirebaseException
import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.FirebaseApp
import dev.gitlive.firebase.android as publicAndroid
Expand All @@ -25,4 +24,4 @@ public actual class FirebasePerformance(internal val android: com.google.firebas
}
}

public actual open class FirebasePerformanceException(message: String) : FirebaseException(message)
public actual open class FirebasePerformanceException(message: String) : com.google.firebase.FirebaseException(message)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.gitlive.firebase.perf.session

import com.google.firebase.perf.session.PerfSession
import com.google.firebase.perf.session.PerfSession as AndroidPerfSession

public val PerfSession.android: PerfSession get() = android
public val PerfSession.android: AndroidPerfSession get() = android

public class PerfSession internal constructor(internal val android: PerfSession)
public class PerfSession internal constructor(internal val android: AndroidPerfSession)

0 comments on commit b0b7c53

Please sign in to comment.