This commit is contained in:
Andrew Golovashevich 2025-03-25 23:16:55 +03:00
parent 28ab658dd2
commit 099c3fad26
2 changed files with 7 additions and 23 deletions

View File

@ -15,7 +15,7 @@ buildscript {
} }
group = "ru.landgrafhomyak.utility" group = "ru.landgrafhomyak.utility"
version = "0.4.5" version = "0.5"
repositories { repositories {
mavenCentral() mavenCentral()
@ -52,21 +52,24 @@ xomrk {
} }
sourceSets { sourceSets {
// if use kotlin("stdlib") gitea ui brokes at paragraph with dependency versions
val kotlinStdlibDependency = "org.jetbrains.kotlin:kotlin-stdlib:${this@kotlin.coreLibrariesVersion}"
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
compileOnly(kotlin("stdlib")) compileOnly(kotlinStdlibDependency)
} }
} }
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {
compileOnly(kotlin("stdlib")) compileOnly(kotlinStdlibDependency)
} }
} }
val nonJvmMain by creating { val nonJvmMain by creating {
dependsOn(commonMain) dependsOn(commonMain)
dependencies { dependencies {
implementation(kotlin("stdlib")) implementation(kotlinStdlibDependency)
} }
} }

View File

@ -3,8 +3,6 @@ package ru.landgrafhomyak.utility.highlevel_try_finally.tests
import org.testng.annotations.Test import org.testng.annotations.Test
import org.testng.asserts.Assertion import org.testng.asserts.Assertion
import ru.landgrafhomyak.utility.highlevel_try_finally.safeAutoClose1 import ru.landgrafhomyak.utility.highlevel_try_finally.safeAutoClose1
import ru.landgrafhomyak.utility.highlevel_try_finally.tryFinallyChain
import java.lang.AssertionError
@Test @Test
class KotlinStdlibDependencyTest { class KotlinStdlibDependencyTest {
@ -47,21 +45,4 @@ class KotlinStdlibDependencyTest {
Assertion().assertTrue(false, "safeAutoClose still has dependency on kotlin stdlib") Assertion().assertTrue(false, "safeAutoClose still has dependency on kotlin stdlib")
} }
} }
@Test(dependsOnMethods = ["testNoKotlinStdlib"])
fun testTryFinallyChain() {
try {
@Suppress("KotlinUnreachableCode")
tryFinallyChain { chain ->
// chain.action { }
chain.action { throw CustomTestException() }
chain.action { throw CustomTestException() }
chain.action { }
chain.action { }
}
} catch (_: CustomTestException) {
} catch (e: LinkageError) {
throw AssertionError("safeAutoClose still has dependency on kotlin stdlib", e)
}
}
} }