File tree Expand file tree Collapse file tree 6 files changed +16
-18
lines changed
androidMain/kotlin/dev/gitlive/firebase/database
iosMain/kotlin/dev/gitlive/firebase/database Expand file tree Collapse file tree 6 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
33import org.gradle.api.tasks.testing.logging.TestLogEvent
44
55plugins {
6- kotlin(" multiplatform" ) version " 1.5.31 " apply false
6+ kotlin(" multiplatform" ) version " 1.5.32 " apply false
77 id(" base" )
88}
99
@@ -17,7 +17,7 @@ buildscript {
1717 }
1818 }
1919 dependencies {
20- classpath(" com.android.tools.build:gradle:7.0.3 " )
20+ classpath(" com.android.tools.build:gradle:7.0.4 " )
2121 classpath(" com.adarshr:gradle-test-logger-plugin:2.1.1" )
2222 }
2323}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ version = project.property("firebase-common.version") as String
99plugins {
1010 id(" com.android.library" )
1111 kotlin(" multiplatform" )
12- kotlin(" plugin.serialization" ) version " 1.5.31 "
12+ kotlin(" plugin.serialization" ) version " 1.5.32 "
1313}
1414
1515android {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ version = project.property("firebase-database.version") as String
1010plugins {
1111 id(" com.android.library" )
1212 kotlin(" multiplatform" )
13- kotlin(" plugin.serialization" ) version " 1.5.31 "
13+ kotlin(" plugin.serialization" ) version " 1.5.32 "
1414}
1515
1616repositories {
@@ -23,17 +23,11 @@ android {
2323 defaultConfig {
2424 minSdk = property(" minSdkVersion" ) as Int
2525 targetSdk = property(" targetSdkVersion" ) as Int
26- testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
27- multiDexEnabled = true
2826 }
2927 sourceSets {
3028 getByName(" main" ) {
3129 manifest.srcFile(" src/androidMain/AndroidManifest.xml" )
3230 }
33- getByName(" androidTest" ){
34- java.srcDir(file(" src/androidAndroidTest/kotlin" ))
35- manifest.srcFile(" src/androidAndroidTest/AndroidManifest.xml" )
36- }
3731 }
3832 testOptions {
3933 unitTests.apply {
@@ -135,9 +129,9 @@ kotlin {
135129 apiVersion = " 1.5"
136130 languageVersion = " 1.5"
137131 progressiveMode = true
138- optIn(" kotlinx.coroutines.ExperimentalCoroutinesApi" )
139- optIn(" kotlinx.coroutines.FlowPreview" )
140- optIn(" kotlinx.serialization.InternalSerializationApi" )
132+ // optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
133+ // optIn("kotlinx.coroutines.FlowPreview")
134+ // optIn("kotlinx.serialization.InternalSerializationApi")
141135 }
142136 }
143137
Original file line number Diff line number Diff line change @@ -195,15 +195,19 @@ actual class DatabaseReference internal constructor(
195195 val deferred = CompletableDeferred <DataSnapshot >()
196196 android.runTransaction(object : Transaction .Handler {
197197
198- override fun doTransaction (currentData : MutableData ) =
199- Transaction .success(transactionUpdate(decode(strategy, currentData)) as MutableData )
198+ override fun doTransaction (currentData : MutableData ): Transaction .Result {
199+ currentData.value = currentData.value?.let {
200+ transactionUpdate(decode(strategy, it))
201+ }
202+ return Transaction .success(currentData)
203+ }
200204
201205 override fun onComplete (
202206 error : DatabaseError ? ,
203207 committed : Boolean ,
204208 snapshot : com.google.firebase.database.DataSnapshot ?
205209 ) {
206- if (error != null ) {
210+ if (error != null ) {
207211 deferred.completeExceptionally(error.toException())
208212 } else {
209213 deferred.complete(DataSnapshot (snapshot!! ))
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ actual class DatabaseReference internal constructor(
165165 val deferred = CompletableDeferred <DataSnapshot >()
166166 ios.runTransactionBlock(
167167 block = { firMutableData ->
168- FIRTransactionResult .successWithValue(transactionUpdate(decode(strategy, firMutableData)) as FIRMutableData )
168+ FIRTransactionResult .successWithValue(transactionUpdate(decode(strategy, firMutableData.value)) )
169169 },
170170 andCompletionBlock = { error, _, snapshot ->
171171 if (error != null ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ version = project.property("firebase-firestore.version") as String
1010plugins {
1111 id(" com.android.library" )
1212 kotlin(" multiplatform" )
13- kotlin(" plugin.serialization" ) version " 1.5.31 "
13+ kotlin(" plugin.serialization" ) version " 1.5.32 "
1414}
1515
1616android {
You can’t perform that action at this time.
0 commit comments