Skip to content

Commit 7fe7a64

Browse files
committed
Fixes to fix CI + cleanup
1 parent 76e1f43 commit 7fe7a64

File tree

7 files changed

+22
-34
lines changed

7 files changed

+22
-34
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ Firebase*.zip
99
/Firebase
1010
.DS_Store
1111
*.log
12-
1312
/kotlin-js-store/
1413
/kotlin-js-store/yarn.lock

firebase-app/build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ plugins {
1010
kotlin("multiplatform")
1111
}
1212

13-
repositories {
14-
google()
15-
mavenCentral()
16-
}
17-
1813
android {
1914
val minSdkVersion: Int by project
2015
val compileSdkVersion: Int by project

firebase-auth/build.gradle.kts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ plugins {
1111
//id("com.quittle.android-emulator") version "0.2.0"
1212
}
1313

14-
//buildscript {
15-
// repositories {
16-
// google()
17-
// gradlePluginPortal()
18-
// }
19-
// dependencies {
20-
// classpath("com.android.tools.build:gradle:3.6.1")
21-
// }
22-
//}
23-
2414
android {
2515
val minSdkVersion: Int by project
2616
val compileSdkVersion: Int by project

firebase-auth/src/androidMain/kotlin/dev/gitlive/firebase/auth/user.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import android.net.Uri
88
import com.google.firebase.auth.UserProfileChangeRequest
99
import kotlinx.coroutines.tasks.await
1010

11-
actual class FirebaseUser internal constructor(val android: com.google.firebase.auth.FirebaseUser) {
11+
actual class FirebaseUser internal constructor(val android: com.google.firebase.auth.FirebaseUser) : FirebaseUserProfile {
1212
actual val uid: String
1313
get() = android.uid
14-
actual val displayName: String?
14+
override val displayName: String?
1515
get() = android.displayName
1616
actual val email: String?
1717
get() = android.email
1818
actual val phoneNumber: String?
1919
get() = android.phoneNumber
20-
actual val photoURL: String?
20+
override val photoURL: String?
2121
get() = android.photoUrl?.toString()
2222
actual val isAnonymous: Boolean
2323
get() = android.isAnonymous
@@ -46,7 +46,7 @@ actual class FirebaseUser internal constructor(val android: com.google.firebase.
4646
actual suspend fun updateEmail(email: String) = android.updateEmail(email).await().run { Unit }
4747
actual suspend fun updatePassword(password: String) = android.updatePassword(password).await().run { Unit }
4848
actual suspend fun updatePhoneNumber(credential: PhoneAuthCredential) = android.updatePhoneNumber(credential.android).await().run { Unit }
49-
actual suspend fun updateProfile(displayName: String?, photoUrl: String?) {
49+
override suspend fun updateProfile(displayName: String?, photoUrl: String?) {
5050
val request = UserProfileChangeRequest.Builder()
5151
.setDisplayName(displayName)
5252
.setPhotoUri(photoUrl?.let { Uri.parse(it) })

firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/user.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44

55
package dev.gitlive.firebase.auth
66

7-
expect class FirebaseUser {
8-
val uid: String
7+
// Javascript IR compilation has issues with referencing to actual values as default parameters, so we should use an interface instead
8+
interface FirebaseUserProfile {
99
val displayName: String?
10+
val photoURL: String?
11+
suspend fun updateProfile(displayName: String? = this.displayName, photoUrl: String? = this.photoURL)
12+
}
13+
14+
expect class FirebaseUser : FirebaseUserProfile {
15+
val uid: String
1016
val email: String?
1117
val phoneNumber: String?
12-
val photoURL: String?
1318
val isAnonymous: Boolean
1419
val isEmailVerified: Boolean
1520
val metaData: UserMetaData?
@@ -28,7 +33,6 @@ expect class FirebaseUser {
2833
suspend fun updateEmail(email: String)
2934
suspend fun updatePassword(password: String)
3035
suspend fun updatePhoneNumber(credential: PhoneAuthCredential)
31-
suspend fun updateProfile(displayName: String? = this.displayName, photoUrl: String? = this.photoURL)
3236
suspend fun verifyBeforeUpdateEmail(newEmail: String, actionCodeSettings: ActionCodeSettings? = null)
3337
}
3438

firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth/user.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ package dev.gitlive.firebase.auth
77
import cocoapods.FirebaseAuth.*
88
import platform.Foundation.NSURL
99

10-
actual class FirebaseUser internal constructor(val ios: FIRUser) {
10+
actual class FirebaseUser internal constructor(val ios: FIRUser) : FirebaseUserProfile {
1111
actual val uid: String
1212
get() = ios.uid
13-
actual val displayName: String?
13+
override val displayName: String?
1414
get() = ios.displayName
1515
actual val email: String?
1616
get() = ios.email
1717
actual val phoneNumber: String?
1818
get() = ios.phoneNumber
19-
actual val photoURL: String?
19+
override val photoURL: String?
2020
get() = ios.photoURL?.absoluteString
2121
actual val isAnonymous: Boolean
2222
get() = ios.anonymous
@@ -64,7 +64,7 @@ actual class FirebaseUser internal constructor(val ios: FIRUser) {
6464
actual suspend fun updateEmail(email: String) = ios.await { updateEmail(email, it) }.run { Unit }
6565
actual suspend fun updatePassword(password: String) = ios.await { updatePassword(password, it) }.run { Unit }
6666
actual suspend fun updatePhoneNumber(credential: PhoneAuthCredential) = ios.await { updatePhoneNumberCredential(credential.ios, it) }.run { Unit }
67-
actual suspend fun updateProfile(displayName: String?, photoUrl: String?) {
67+
override suspend fun updateProfile(displayName: String?, photoUrl: String?) {
6868
val request = ios.profileChangeRequest().apply {
6969
this.displayName = displayName
7070
this.photoURL = photoUrl?.let { NSURL.URLWithString(it) }

firebase-auth/src/jsMain/kotlin/dev/gitlive/firebase/auth/user.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import dev.gitlive.firebase.firebase
44
import kotlinx.coroutines.await
55
import kotlin.js.Date
66

7-
actual class FirebaseUser internal constructor(val js: firebase.user.User) {
7+
actual class FirebaseUser internal constructor(val js: firebase.user.User) : FirebaseUserProfile {
88
actual val uid: String
99
get() = rethrow { js.uid }
10-
actual val displayName: String?
10+
override val displayName: String?
1111
get() = rethrow { js.displayName }
1212
actual val email: String?
1313
get() = rethrow { js.email }
1414
actual val phoneNumber: String?
1515
get() = rethrow { js.phoneNumber }
16-
actual val photoURL: String?
16+
override val photoURL: String?
1717
get() = rethrow { js.photoURL }
1818
actual val isAnonymous: Boolean
1919
get() = rethrow { js.isAnonymous }
@@ -43,7 +43,7 @@ actual class FirebaseUser internal constructor(val js: firebase.user.User) {
4343
actual suspend fun updateEmail(email: String) = rethrow { js.updateEmail(email).await() }
4444
actual suspend fun updatePassword(password: String) = rethrow { js.updatePassword(password).await() }
4545
actual suspend fun updatePhoneNumber(credential: PhoneAuthCredential) = rethrow { js.updatePhoneNumber(credential.js).await() }
46-
actual suspend fun updateProfile(displayName: String?, photoUrl: String?) = rethrow {
46+
override suspend fun updateProfile(displayName: String?, photoUrl: String?) = rethrow {
4747
val request = object : firebase.user.ProfileUpdateRequest {
4848
override val displayName: String? = displayName
4949
override val photoURL: String? = photoUrl
@@ -56,9 +56,9 @@ actual class FirebaseUser internal constructor(val js: firebase.user.User) {
5656
actual class UserInfo(val js: firebase.user.UserInfo) {
5757
actual val displayName: String?
5858
get() = rethrow { js.displayName }
59-
actual val email: String?
59+
actual val email: String?
6060
get() = rethrow { js.email }
61-
actual val phoneNumber: String?
61+
actual val phoneNumber: String?
6262
get() = rethrow { js.phoneNumber }
6363
actual val photoURL: String?
6464
get() = rethrow { js.photoURL }

0 commit comments

Comments
 (0)