Fixes to remove kotlin-stdlib dependency
This commit is contained in:
parent
c078394921
commit
7d56a44323
@ -64,13 +64,13 @@ xomrk {
|
||||
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation(kotlinStdlibDependency)
|
||||
compileOnly(kotlinStdlibDependency)
|
||||
implementation("ru.landgrafhomyak.utility:highlevel-try-finally:0.6")
|
||||
}
|
||||
}
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-test:${this@kotlin.coreLibrariesVersion}")
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-test:${this@kotlin.coreLibrariesVersion}")
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,6 +80,12 @@ xomrk {
|
||||
}
|
||||
}
|
||||
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation("org.testng:testng:7.5.1")
|
||||
}
|
||||
}
|
||||
|
||||
val nonJvmMain by creating {
|
||||
dependsOn(commonMain)
|
||||
dependencies {
|
||||
@ -88,11 +94,6 @@ xomrk {
|
||||
}
|
||||
}
|
||||
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation("org.testng:testng:7.5.1")
|
||||
}
|
||||
}
|
||||
|
||||
configureEach {
|
||||
when {
|
||||
|
||||
@ -31,9 +31,8 @@ public sealed class ChildCloseableState<T : CloseableState> : CloseableState {
|
||||
|
||||
@ManualStateManipulation
|
||||
override fun close() {
|
||||
this._parent.tryFinishUsage {
|
||||
this._state.finishUsage()
|
||||
}
|
||||
this._state.finishUsage()
|
||||
this._parent.finishUsage()
|
||||
}
|
||||
|
||||
abstract override fun toString(): String
|
||||
|
||||
@ -9,6 +9,7 @@ import ru.landgrafhomyak.utility.highlevel_try_finally.safeAutoClose1
|
||||
import ru.landgrafhomyak.utility.highlevel_try_finally.safeAutoClose2
|
||||
|
||||
@OptIn(ManualStateManipulation::class)
|
||||
@JvmName("autoClosed\$kt")
|
||||
public inline fun <S : CloseableState, R> autoClosed(
|
||||
constructor: () -> S,
|
||||
scope: (S) -> R,
|
||||
@ -31,7 +32,7 @@ public inline fun <R> CloseableState.withUse(block: () -> R): R {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
this.startUsage()
|
||||
return safeAutoClose1(action = block, finally = this::finishUsage)
|
||||
return safeAutoClose1(action = block, finally = { this.finishUsage() })
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +43,7 @@ public inline fun <R> CloseableState.tryStartUsage(block: () -> R): R {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
this.startUsage()
|
||||
return safeAutoClose2(action = block, onError = this::finishUsage)
|
||||
return safeAutoClose2(action = block, onError ={ this.finishUsage() })
|
||||
}
|
||||
|
||||
@ManualStateManipulation
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
package ru.landgrafhomyak.utility.closeable_state_1
|
||||
|
||||
public actual typealias UsagesCounter = jUsagesCounter
|
||||
public actual typealias ErrorOnConcurrentAccessState = jErrorOnConcurrentAccessState
|
||||
public actual typealias ErrorOnConcurrentAccessState = jErrorOnConcurrentAccessState
|
||||
public actual typealias CloseableStateCloseableWrapper = jCloseableStateCloseableWrapper
|
||||
Loading…
Reference in New Issue
Block a user