From 77c8278b42f5ec371264e3d95e929bdf7f5d6ea7 Mon Sep 17 00:00:00 2001 From: Pablo Valdes Date: Sat, 26 Oct 2024 20:59:40 -0400 Subject: [PATCH] Update gradle Update kotlin Update Macao SDK --- .../plugin/account/SupabaseAccountPlugin.kt | 34 ++++++------ gradle.properties | 3 ++ gradle/libs.versions.toml | 53 ++++++++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 54 insertions(+), 38 deletions(-) diff --git a/auth-supabase/src/commonMain/kotlin/com/macaosoftware/plugin/account/SupabaseAccountPlugin.kt b/auth-supabase/src/commonMain/kotlin/com/macaosoftware/plugin/account/SupabaseAccountPlugin.kt index 3a97a9f..cf9a7dc 100644 --- a/auth-supabase/src/commonMain/kotlin/com/macaosoftware/plugin/account/SupabaseAccountPlugin.kt +++ b/auth-supabase/src/commonMain/kotlin/com/macaosoftware/plugin/account/SupabaseAccountPlugin.kt @@ -43,7 +43,7 @@ class SupabaseAccountPlugin : AccountPlugin { return true } - override suspend fun createUserWithEmailAndPassword(signUpRequest: SignUpRequest): MacaoResult = try { + override suspend fun createUserWithEmailAndPassword(signUpRequest: SignUpRequest): MacaoResult = try { supabase.auth.signUpWith(Email) { email = "example@email.com" @@ -58,7 +58,7 @@ class SupabaseAccountPlugin : AccountPlugin { MacaoResult.Error(SignupError(errorDescription = ex.message.orEmpty())) } - override suspend fun signInWithEmailAndPassword(signInRequest: SignInRequest): MacaoResult = try { + override suspend fun signInWithEmailAndPassword(signInRequest: SignInRequest): MacaoResult = try { withContext(Dispatchers.Main) { withTimeout(15.seconds) { @@ -106,7 +106,7 @@ class SupabaseAccountPlugin : AccountPlugin { MacaoResult.Error(LoginError(errorDescription = ex.message.orEmpty())) } - override suspend fun signInWithEmailLink(signInRequest: SignInRequestForEmailLink): MacaoResult = try { + override suspend fun signInWithEmailLink(signInRequest: SignInRequestForEmailLink): MacaoResult = try { withTimeout(15.seconds) { supabase.auth @@ -150,7 +150,7 @@ class SupabaseAccountPlugin : AccountPlugin { MacaoResult.Error(LoginError(errorDescription = ex.message.orEmpty())) } - override suspend fun sendSignInLinkToEmail(emailLinkData: EmailLinkData): MacaoResult = try { + override suspend fun sendSignInLinkToEmail(emailLinkData: EmailLinkData): MacaoResult = try { supabase.auth.verifyEmailOtp( type = OtpType.Email.MAGIC_LINK, @@ -164,7 +164,7 @@ class SupabaseAccountPlugin : AccountPlugin { MacaoResult.Error(SignupError(errorDescription = ex.message.orEmpty())) } - override suspend fun getCurrentUser(): MacaoResult = try { + override suspend fun getCurrentUser(): MacaoResult = try { val user = supabase.auth.retrieveUserForCurrentSession(updateSession = true) MacaoResult.Success(user.toMacaoUser()) @@ -173,11 +173,11 @@ class SupabaseAccountPlugin : AccountPlugin { MacaoResult.Error(SignupError(errorDescription = ex.message.orEmpty())) } - override suspend fun getProviderData(): MacaoResult { + override suspend fun getProviderData(): MacaoResult { TODO("Not yet implemented") } - override suspend fun updateProfile(displayName: String, photoUrl: String): MacaoResult { + override suspend fun updateProfile(displayName: String, photoUrl: String): MacaoResult { TODO("Not yet implemented") } @@ -189,45 +189,45 @@ class SupabaseAccountPlugin : AccountPlugin { facebookLink: String?, linkedIn: String?, github: String? - ): MacaoResult { + ): MacaoResult { TODO("Not yet implemented") } - override suspend fun updateEmail(newEmail: String): MacaoResult { + override suspend fun updateEmail(newEmail: String): MacaoResult { TODO("Not yet implemented") } - override suspend fun updatePassword(newPassword: String): MacaoResult { + override suspend fun updatePassword(newPassword: String): MacaoResult { TODO("Not yet implemented") } - override suspend fun sendEmailVerification(): MacaoResult { + override suspend fun sendEmailVerification(): MacaoResult { TODO("Not yet implemented") } - override suspend fun sendPasswordReset(): MacaoResult { + override suspend fun sendPasswordReset(): MacaoResult { TODO("Not yet implemented") } - override suspend fun deleteUser(): MacaoResult { + override suspend fun deleteUser(): MacaoResult { TODO("Not yet implemented") } - override suspend fun fetchUserData(): MacaoResult { + override suspend fun fetchUserData(): MacaoResult { TODO("Not yet implemented") } - override suspend fun checkAndFetchUserData(): MacaoResult { + override suspend fun checkAndFetchUserData(): MacaoResult { println("Supabase_checkAndFetchUserData") return MacaoResult.Error(SignupError(errorDescription = "")) } - override suspend fun signOut(): MacaoResult = try { + override suspend fun signOut(): MacaoResult = 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 { diff --git a/gradle.properties b/gradle.properties index 1da3bcf..2afd81f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 76726b9..ecf0fe4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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] @@ -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" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3fa8f86..df97d72 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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