Skip to content

Commit

Permalink
Update gradle
Browse files Browse the repository at this point in the history
Update kotlin
Update Macao SDK
  • Loading branch information
pablichjenkov committed Oct 27, 2024
1 parent bdcbe9f commit 77c8278
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class SupabaseAccountPlugin : AccountPlugin {
return true
}

override suspend fun createUserWithEmailAndPassword(signUpRequest: SignUpRequest): MacaoResult<MacaoUser> = try {
override suspend fun createUserWithEmailAndPassword(signUpRequest: SignUpRequest): MacaoResult<MacaoUser, SignupError> = try {

supabase.auth.signUpWith(Email) {
email = "[email protected]"
Expand All @@ -58,7 +58,7 @@ class SupabaseAccountPlugin : AccountPlugin {
MacaoResult.Error(SignupError(errorDescription = ex.message.orEmpty()))
}

override suspend fun signInWithEmailAndPassword(signInRequest: SignInRequest): MacaoResult<MacaoUser> = try {
override suspend fun signInWithEmailAndPassword(signInRequest: SignInRequest): MacaoResult<MacaoUser, LoginError> = try {

withContext(Dispatchers.Main) {
withTimeout(15.seconds) {
Expand Down Expand Up @@ -106,7 +106,7 @@ class SupabaseAccountPlugin : AccountPlugin {
MacaoResult.Error(LoginError(errorDescription = ex.message.orEmpty()))
}

override suspend fun signInWithEmailLink(signInRequest: SignInRequestForEmailLink): MacaoResult<MacaoUser> = try {
override suspend fun signInWithEmailLink(signInRequest: SignInRequestForEmailLink): MacaoResult<MacaoUser, LoginError> = try {

withTimeout(15.seconds) {
supabase.auth
Expand Down Expand Up @@ -150,7 +150,7 @@ class SupabaseAccountPlugin : AccountPlugin {
MacaoResult.Error(LoginError(errorDescription = ex.message.orEmpty()))
}

override suspend fun sendSignInLinkToEmail(emailLinkData: EmailLinkData): MacaoResult<Unit> = try {
override suspend fun sendSignInLinkToEmail(emailLinkData: EmailLinkData): MacaoResult<Unit, AccountPluginError> = try {

supabase.auth.verifyEmailOtp(
type = OtpType.Email.MAGIC_LINK,
Expand All @@ -164,7 +164,7 @@ class SupabaseAccountPlugin : AccountPlugin {
MacaoResult.Error(SignupError(errorDescription = ex.message.orEmpty()))
}

override suspend fun getCurrentUser(): MacaoResult<MacaoUser> = try {
override suspend fun getCurrentUser(): MacaoResult<MacaoUser, SignupError> = try {

val user = supabase.auth.retrieveUserForCurrentSession(updateSession = true)
MacaoResult.Success(user.toMacaoUser())
Expand All @@ -173,11 +173,11 @@ class SupabaseAccountPlugin : AccountPlugin {
MacaoResult.Error(SignupError(errorDescription = ex.message.orEmpty()))
}

override suspend fun getProviderData(): MacaoResult<ProviderData> {
override suspend fun getProviderData(): MacaoResult<ProviderData, SignupError> {
TODO("Not yet implemented")
}

override suspend fun updateProfile(displayName: String, photoUrl: String): MacaoResult<MacaoUser> {
override suspend fun updateProfile(displayName: String, photoUrl: String): MacaoResult<MacaoUser, SignupError> {
TODO("Not yet implemented")
}

Expand All @@ -189,45 +189,45 @@ class SupabaseAccountPlugin : AccountPlugin {
facebookLink: String?,
linkedIn: String?,
github: String?
): MacaoResult<UserData> {
): MacaoResult<UserData, SignupError> {
TODO("Not yet implemented")
}

override suspend fun updateEmail(newEmail: String): MacaoResult<MacaoUser> {
override suspend fun updateEmail(newEmail: String): MacaoResult<MacaoUser, SignupError> {
TODO("Not yet implemented")
}

override suspend fun updatePassword(newPassword: String): MacaoResult<MacaoUser> {
override suspend fun updatePassword(newPassword: String): MacaoResult<MacaoUser, SignupError> {
TODO("Not yet implemented")
}

override suspend fun sendEmailVerification(): MacaoResult<MacaoUser> {
override suspend fun sendEmailVerification(): MacaoResult<MacaoUser, SignupError> {
TODO("Not yet implemented")
}

override suspend fun sendPasswordReset(): MacaoResult<MacaoUser> {
override suspend fun sendPasswordReset(): MacaoResult<MacaoUser, SignupError> {
TODO("Not yet implemented")
}

override suspend fun deleteUser(): MacaoResult<Unit> {
override suspend fun deleteUser(): MacaoResult<Unit, SignupError> {
TODO("Not yet implemented")
}

override suspend fun fetchUserData(): MacaoResult<UserData> {
override suspend fun fetchUserData(): MacaoResult<UserData, SignupError> {
TODO("Not yet implemented")
}

override suspend fun checkAndFetchUserData(): MacaoResult<UserData> {
override suspend fun checkAndFetchUserData(): MacaoResult<UserData, SignupError> {
println("Supabase_checkAndFetchUserData")
return MacaoResult.Error(SignupError(errorDescription = ""))
}

override suspend fun signOut(): MacaoResult<Unit> = try {
override suspend fun signOut(): MacaoResult<Unit, SignupError> = try {
supabase.auth.signOut(SignOutScope.LOCAL)
MacaoResult.Success(Unit)
} catch (ex: Exception) {
ex.printStackTrace()
MacaoResult.Error(LoginError(errorDescription = ex.message.orEmpty()))
MacaoResult.Error(SignupError(errorDescription = ex.message.orEmpty()))
}

private fun Email.Result.toMacaoUser(): MacaoUser {
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ mavenCentral.pass=fake-maven-pass
ThemeFlavorProvider=A
AuthPluginFlavorProvider=Firebase
LoggerPluginProvider=Development

# Bug: https://youtrack.jetbrains.com/issue/KT-66919/Inconsistent-JVM-target-compatibility-detected-for-tasks-error-still-shown-when-Kotlin-auto-selected-a-lower-target
kotlin.jvm.target.validation.mode=IGNORE
53 changes: 33 additions & 20 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
[versions]

## Kotlin Ecosystem
kotlinVersion = "2.0.21"
kotlinxCoroutines = "1.9.0"
kotlinxDatetime = "0.6.1"
kotlinxSerialization = "1.7.3"
dokka = "1.9.10"

## Compose
composeAndroidCompiler = "1.7.4"
composeVersion = "1.7.0"

## Android Gradle Plugin
agp = "8.5.2"
androidCompileSdk = "34"
androidTargetSdk = "34"
androidMinSdk = "26"

## Macao Libs
macaoAmadeusApi = "0.3.4"
macaoComponentToolkit = "0.6.11"
macaoComponentToolkit = "0.7.0"
macaoAuthFirebase = "0.0.1-dev"
koinCore = "3.6.0-wasm-alpha2"
kotlin = "2.0.20"
agp = "8.1.4"
composeAndroidCompiler = "1.6.7"
composePlugin = "1.6.10"
androidxActivityCompose = "1.9.2"
kamelImage = "0.9.4"
kotlinxCoroutines = "1.8.1"
ktor = "2.3.11"

# Koin
koinCore = "4.0.0"

## AndroidX
androidxActivityCompose = "1.9.3"

## Misc
composeIcons = "1.1.0"
kotlinxSerialization = "1.6.3"
kotlinxDatetime = "0.6.0"
multiplatformSettings = "1.1.1"
gmazzo = "5.3.5"
sqldelight = "2.0.2"
dokka = "1.9.10"
gmazzo = "5.5.0"
kamelImage = "1.0.1"
ktor = "3.0.0"
multiplatformSettings = "1.2.0"
realm = "1.12.0"
sqldelight = "2.0.2"

[libraries]

Expand Down Expand Up @@ -75,12 +88,12 @@ koin-test = { module = "io.insert-koin:koin-test", version.ref = "koinCore" }

[plugins]

kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
compose = { id = "org.jetbrains.compose", version.ref = "composePlugin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlinVersion" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVersion" }
compose = { id = "org.jetbrains.compose", version.ref = "composeVersion" }
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinVersion" }
gmazzo = { id = "com.github.gmazzo.buildconfig", version.ref = "gmazzo" }
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 77c8278

Please sign in to comment.