Skip to content

Commit

Permalink
Update dependencies, use concurrent memory manager and remove freezing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nillerr committed Oct 11, 2022
1 parent 5e93846 commit c3d5421
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 28 deletions.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kotlin.mpp.stability.nowarn=true
#kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true
#kotlin.native.enableDependencyPropagation=false
kotlin.native.binary.memoryModel=experimental

#Android
android.useAndroidX=true
Expand Down
1 change: 1 addition & 0 deletions kontinuity-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ kotlin {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:atomicfu:0.18.4")
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package io.mockative.kontinuity.internal
typealias KontinuityCallback<T> = (T, Unit) -> Unit

@Suppress("NOTHING_TO_INLINE")
internal inline operator fun <T> KontinuityCallback<T>.invoke(value: T) = invoke(value.freeze(), Unit)
internal inline operator fun <T> KontinuityCallback<T>.invoke(value: T) = invoke(value, Unit)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import kotlinx.coroutines.Job
typealias KontinuityCancellable = () -> Unit

@Suppress("NOTHING_TO_INLINE")
internal inline fun Job.asNativeCancellable(): KontinuityCancellable = { cancel() }.freeze()
internal inline fun Job.asNativeCancellable(): KontinuityCancellable = { cancel() }
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ fun <T> Flow<T>.toKontinuityFlow(scope: CoroutineScope? = null): KontinuityFlow<
job.asNativeCancellable()
}

return flow.freeze()
return flow
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ fun <T> StateFlow<T>.toKontinuityStateFlow(scope: CoroutineScope? = null): Konti
}
}

return stateFlow.freeze()
return stateFlow
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ fun <T> kontinuitySuspend(scope: CoroutineScope? = null, block: suspend () -> T)
job.asNativeCancellable()
}

return suspend.freeze()
return suspend
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ actual typealias KontinuityError = NSError
@OptIn(UnsafeNumber::class)
internal actual fun Throwable.asKontinuityError(): KontinuityError {
val userInfo = mutableMapOf<Any?, Any>()
userInfo["KotlinException"] = this.freeze()
userInfo["KotlinException"] = this

val message = message
if (message != null) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ kotlin {
val commonMain by getting {
dependencies {
// KotlinX
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")

// Kontinuity
implementation(project(":kontinuity-core"))
Expand All @@ -62,7 +62,7 @@ kotlin {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))

implementation("io.mockative:mockative:1.2.1")
implementation("io.mockative:mockative:1.2.5")
}
}

Expand Down Expand Up @@ -103,7 +103,7 @@ dependencies {
configurations
.filter { it.name.startsWith("ksp") && it.name.contains("Test") }
.forEach {
add(it.name, "io.mockative:mockative-processor:1.2.1")
add(it.name, "io.mockative:mockative-processor:1.2.5")
}
}

Expand All @@ -124,7 +124,7 @@ android {

dependencies {
androidTestImplementation("androidx.test:runner:1.4.0")
androidTestUtil("androidx.test:orchestrator:1.4.0")
androidTestUtil("androidx.test:orchestrator:1.4.1")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class AuthenticationServiceTests {
val mutex = Mutex()
mutex.lock()

kAuthenticationService.loginK(request).invoke(
val kSuspend = kAuthenticationService.loginK(request)
kSuspend.invoke(
{ value, _ ->
resultOrNull = Result.success(value)
mutex.unlock()
Expand Down

0 comments on commit c3d5421

Please sign in to comment.