[Gradle] Update NativeExternalDependenciesIT to reflect changes in stdlib

^KT-60901 Verification Pending
This commit is contained in:
Sebastian Sellmair
2023-08-09 15:23:53 +02:00
committed by Space Team
parent ada446b68f
commit 65e467dd5b
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.gradle.native
import org.gradle.util.GradleVersion
import org.jetbrains.kotlin.gradle.KOTLIN_VERSION
import org.jetbrains.kotlin.gradle.testbase.*
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.condition.DisabledOnOs
@@ -25,40 +26,44 @@ internal class NativeExternalDependenciesIT : KGPBaseTest() {
@GradleTest
fun shouldNotUseExternalDependencies(gradleVersion: GradleVersion) {
buildProjectWithDependencies(gradleVersion) { externalDependenciesText ->
assertNull(externalDependenciesText)
assertEquals(
"""
|0 native-external-dependencies
|1 org.jetbrains.kotlin:kotlin-stdlib[$KOTLIN_VERSION] #0[$KOTLIN_VERSION]
|
""".trimMargin(),
externalDependenciesText
)
}
}
@DisplayName("Should build with ktor 1.5.4 and coroutines 1.5.0-RC-native-mt")
@GradleTest
@DisabledOnOs(
value = [OS.MAC],
architectures = ["aarch64"],
disabledReason = "These versions of Ktor and coroutines don't support macos-arm64"
)
fun shouldUseOldKtorAndCoroutinesExternalDependencies(gradleVersion: GradleVersion) {
buildProjectWithDependencies(
gradleVersion,
"io.ktor:ktor-io:1.5.4",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC-native-mt"
"io.ktor:ktor-io:2.3.3",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2"
) { externalDependenciesText ->
assertNotNull(externalDependenciesText)
assertEquals(
"""
|0 native-external-dependencies
|1 io.ktor:ktor-io,io.ktor:ktor-io-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[1.5.4] #0[1.5.4]
|${'\t'}/some/path/ktor-io.klib
|${'\t'}/some/path/ktor-io-cinterop-bits.klib
|${'\t'}/some/path/ktor-io-cinterop-sockets.klib
|2 org.jetbrains.kotlinx:atomicfu,org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[0.16.1] #3[0.16.1] #1[0.15.1]
|${'\t'}/some/path/atomicfu.klib
|${'\t'}/some/path/atomicfu-cinterop-interop.klib
|3 org.jetbrains.kotlinx:kotlinx-coroutines-core,org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[1.5.0-RC-native-mt] #0[1.5.0-RC-native-mt] #1[1.4.3-native-mt]
|${'\t'}/some/path/kotlinx-coroutines-core.klib
|
""".trimMargin(),
assertEquals("""
0 native-external-dependencies
1 io.ktor:ktor-io,io.ktor:ktor-io-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[2.3.3] #0[2.3.3]
/some/path/ktor-io.klib
2 org.jetbrains.kotlin:kotlin-stdlib[$KOTLIN_VERSION] #0[$KOTLIN_VERSION] #4[$KOTLIN_VERSION] #3[$KOTLIN_VERSION]
3 org.jetbrains.kotlin:kotlin-stdlib-jdk7[$KOTLIN_VERSION] #4[$KOTLIN_VERSION]
/some/path/kotlin-stdlib-jdk7-$KOTLIN_VERSION.jar
4 org.jetbrains.kotlin:kotlin-stdlib-jdk8[$KOTLIN_VERSION] #6[1.8.20]
/some/path/kotlin-stdlib-jdk8-$KOTLIN_VERSION.jar
5 org.jetbrains.kotlinx:atomicfu,org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[0.21.0] #6[0.21.0] #1[0.19.0]
/some/path/atomicfu.klib
/some/path/atomicfu-cinterop-interop.klib
6 org.jetbrains.kotlinx:kotlinx-coroutines-core,org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[1.7.2] #0[1.7.2] #1[1.7.1]
/some/path/kotlinx-coroutines-core.klib
""".trimIndent(),
externalDependenciesText
)
}
@@ -81,10 +86,11 @@ internal class NativeExternalDependenciesIT : KGPBaseTest() {
|${'\t'}/some/path/ktor-io.klib
|${'\t'}/some/path/ktor-io-cinterop-bits.klib
|${'\t'}/some/path/ktor-io-cinterop-sockets.klib
|2 org.jetbrains.kotlinx:atomicfu,org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[0.16.3] #3[0.16.3] #1[0.16.3]
|2 org.jetbrains.kotlin:kotlin-stdlib[$KOTLIN_VERSION] #0[$KOTLIN_VERSION]
|3 org.jetbrains.kotlinx:atomicfu,org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[0.16.3] #4[0.16.3] #1[0.16.3]
|${'\t'}/some/path/atomicfu.klib
|${'\t'}/some/path/atomicfu-cinterop-interop.klib
|3 org.jetbrains.kotlinx:kotlinx-coroutines-core,org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[1.5.2-native-mt] #0[1.5.2-native-mt] #1[1.5.2-native-mt]
|4 org.jetbrains.kotlinx:kotlinx-coroutines-core,org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[1.5.2-native-mt] #0[1.5.2-native-mt] #1[1.5.2-native-mt]
|${'\t'}/some/path/kotlinx-coroutines-core.klib
|
""".trimMargin(),
@@ -96,7 +102,7 @@ internal class NativeExternalDependenciesIT : KGPBaseTest() {
private fun buildProjectWithDependencies(
gradleVersion: GradleVersion,
vararg dependencies: String,
externalDependenciesTextConsumer: (externalDependenciesText: String?) -> Unit
externalDependenciesTextConsumer: (externalDependenciesText: String?) -> Unit,
) {
nativeProject("native-external-dependencies", gradleVersion) {
buildGradleKts.appendText(