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
3
3
import org.gradle.api.tasks.testing.logging.TestLogEvent
4
4
5
5
plugins {
6
- kotlin(" multiplatform" ) version " 1.5.31 " apply false
6
+ kotlin(" multiplatform" ) version " 1.5.32 " apply false
7
7
id(" base" )
8
8
}
9
9
@@ -17,7 +17,7 @@ buildscript {
17
17
}
18
18
}
19
19
dependencies {
20
- classpath(" com.android.tools.build:gradle:7.0.3 " )
20
+ classpath(" com.android.tools.build:gradle:7.0.4 " )
21
21
classpath(" com.adarshr:gradle-test-logger-plugin:2.1.1" )
22
22
}
23
23
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ version = project.property("firebase-common.version") as String
9
9
plugins {
10
10
id(" com.android.library" )
11
11
kotlin(" multiplatform" )
12
- kotlin(" plugin.serialization" ) version " 1.5.31 "
12
+ kotlin(" plugin.serialization" ) version " 1.5.32 "
13
13
}
14
14
15
15
android {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ version = project.property("firebase-database.version") as String
10
10
plugins {
11
11
id(" com.android.library" )
12
12
kotlin(" multiplatform" )
13
- kotlin(" plugin.serialization" ) version " 1.5.31 "
13
+ kotlin(" plugin.serialization" ) version " 1.5.32 "
14
14
}
15
15
16
16
repositories {
@@ -23,17 +23,11 @@ android {
23
23
defaultConfig {
24
24
minSdk = property(" minSdkVersion" ) as Int
25
25
targetSdk = property(" targetSdkVersion" ) as Int
26
- testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
27
- multiDexEnabled = true
28
26
}
29
27
sourceSets {
30
28
getByName(" main" ) {
31
29
manifest.srcFile(" src/androidMain/AndroidManifest.xml" )
32
30
}
33
- getByName(" androidTest" ){
34
- java.srcDir(file(" src/androidAndroidTest/kotlin" ))
35
- manifest.srcFile(" src/androidAndroidTest/AndroidManifest.xml" )
36
- }
37
31
}
38
32
testOptions {
39
33
unitTests.apply {
@@ -135,9 +129,9 @@ kotlin {
135
129
apiVersion = " 1.5"
136
130
languageVersion = " 1.5"
137
131
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")
141
135
}
142
136
}
143
137
Original file line number Diff line number Diff line change @@ -195,15 +195,19 @@ actual class DatabaseReference internal constructor(
195
195
val deferred = CompletableDeferred <DataSnapshot >()
196
196
android.runTransaction(object : Transaction .Handler {
197
197
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
+ }
200
204
201
205
override fun onComplete (
202
206
error : DatabaseError ? ,
203
207
committed : Boolean ,
204
208
snapshot : com.google.firebase.database.DataSnapshot ?
205
209
) {
206
- if (error != null ) {
210
+ if (error != null ) {
207
211
deferred.completeExceptionally(error.toException())
208
212
} else {
209
213
deferred.complete(DataSnapshot (snapshot!! ))
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ actual class DatabaseReference internal constructor(
165
165
val deferred = CompletableDeferred <DataSnapshot >()
166
166
ios.runTransactionBlock(
167
167
block = { firMutableData ->
168
- FIRTransactionResult .successWithValue(transactionUpdate(decode(strategy, firMutableData)) as FIRMutableData )
168
+ FIRTransactionResult .successWithValue(transactionUpdate(decode(strategy, firMutableData.value)) )
169
169
},
170
170
andCompletionBlock = { error, _, snapshot ->
171
171
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
10
10
plugins {
11
11
id(" com.android.library" )
12
12
kotlin(" multiplatform" )
13
- kotlin(" plugin.serialization" ) version " 1.5.31 "
13
+ kotlin(" plugin.serialization" ) version " 1.5.32 "
14
14
}
15
15
16
16
android {
You can’t perform that action at this time.
0 commit comments