migrated NativeExternalDependenciesIT to gradle TestKit
This commit is contained in:
committed by
Space Team
parent
8466bec048
commit
9c32a66e9c
+50
-64
@@ -1,37 +1,45 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.native
|
package org.jetbrains.kotlin.gradle.native
|
||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
import org.gradle.util.GradleVersion
|
||||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
import org.jetbrains.kotlin.konan.target.HostManager
|
import org.junit.jupiter.api.DisplayName
|
||||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
import org.junit.jupiter.api.condition.DisabledOnOs
|
||||||
import org.junit.Assume.assumeFalse
|
import org.junit.jupiter.api.condition.OS
|
||||||
import org.junit.Test
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import kotlin.io.path.appendText
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertNotNull
|
import kotlin.test.assertNotNull
|
||||||
import kotlin.test.assertNull
|
import kotlin.test.assertNull
|
||||||
|
|
||||||
class NativeExternalDependenciesIT : BaseGradleIT() {
|
@DisplayName("Tests for K/N builds with external dependencies")
|
||||||
override val defaultGradleVersion: GradleVersionRequired
|
@NativeGradlePluginTests
|
||||||
get() = GradleVersionRequired.FOR_MPP_SUPPORT
|
internal class NativeExternalDependenciesIT : KGPBaseTest() {
|
||||||
|
|
||||||
@Test
|
@DisplayName("K/N shouldn't contain any external dependencies by default")
|
||||||
fun `no external dependencies`() = buildProjectWithDependencies { externalDependenciesText ->
|
@GradleTest
|
||||||
assertNull(externalDependenciesText)
|
fun shouldNotUseExternalDependencies(gradleVersion: GradleVersion) {
|
||||||
|
buildProjectWithDependencies(gradleVersion) { externalDependenciesText ->
|
||||||
|
assertNull(externalDependenciesText)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@DisplayName("Should build with ktor 1.5.4 and coroutines 1.5.0-RC-native-mt")
|
||||||
fun `ktor 1_5_4 and coroutines 1_5_0-RC-native-mt`() {
|
@GradleTest
|
||||||
// These versions of Ktor and coroutines don't support macos-arm64
|
@DisabledOnOs(
|
||||||
assumeFalse(hostIsMacArm64())
|
value = [OS.MAC],
|
||||||
|
architectures = ["aarch64"],
|
||||||
|
disabledReason = "These versions of Ktor and coroutines don't support macos-arm64"
|
||||||
|
)
|
||||||
|
fun shouldUseOldKtorAndCoroutinesExternalDependencies(gradleVersion: GradleVersion) {
|
||||||
|
|
||||||
buildProjectWithDependencies(
|
buildProjectWithDependencies(
|
||||||
|
gradleVersion,
|
||||||
"io.ktor:ktor-io:1.5.4",
|
"io.ktor:ktor-io:1.5.4",
|
||||||
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC-native-mt"
|
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC-native-mt"
|
||||||
) { externalDependenciesText ->
|
) { externalDependenciesText ->
|
||||||
@@ -40,14 +48,14 @@ class NativeExternalDependenciesIT : BaseGradleIT() {
|
|||||||
assertEquals(
|
assertEquals(
|
||||||
"""
|
"""
|
||||||
|0 native-external-dependencies
|
|0 native-external-dependencies
|
||||||
|1 io.ktor:ktor-io,io.ktor:ktor-io-$MASKED_TARGET_NAME[1.5.4] #0[1.5.4]
|
|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.klib
|
||||||
|${'\t'}/some/path/ktor-io-cinterop-bits.klib
|
|${'\t'}/some/path/ktor-io-cinterop-bits.klib
|
||||||
|${'\t'}/some/path/ktor-io-cinterop-sockets.klib
|
|${'\t'}/some/path/ktor-io-cinterop-sockets.klib
|
||||||
|2 org.jetbrains.kotlinx:atomicfu,org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME[0.16.1] #3[0.16.1] #1[0.15.1]
|
|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.klib
|
||||||
|${'\t'}/some/path/atomicfu-cinterop-interop.klib
|
|${'\t'}/some/path/atomicfu-cinterop-interop.klib
|
||||||
|3 org.jetbrains.kotlinx:kotlinx-coroutines-core,org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME[1.5.0-RC-native-mt] #0[1.5.0-RC-native-mt] #1[1.4.3-native-mt]
|
|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
|
|${'\t'}/some/path/kotlinx-coroutines-core.klib
|
||||||
|
|
|
|
||||||
""".trimMargin(),
|
""".trimMargin(),
|
||||||
@@ -56,37 +64,42 @@ class NativeExternalDependenciesIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@DisplayName("Should build with ktor 1.6.5 and coroutines 1.5.2-native-mt")
|
||||||
fun `ktor 1_6_5 and coroutines 1_5_2-native-mt`() = buildProjectWithDependencies(
|
@GradleTest
|
||||||
"io.ktor:ktor-io:1.6.5",
|
fun shouldUseKtorAndCoroutinesExternalDependencies(gradleVersion: GradleVersion) {
|
||||||
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2-native-mt"
|
buildProjectWithDependencies(
|
||||||
) { externalDependenciesText ->
|
gradleVersion,
|
||||||
assertNotNull(externalDependenciesText)
|
"io.ktor:ktor-io:1.6.5",
|
||||||
|
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2-native-mt"
|
||||||
|
) { externalDependenciesText ->
|
||||||
|
assertNotNull(externalDependenciesText)
|
||||||
|
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"""
|
"""
|
||||||
|0 native-external-dependencies
|
|0 native-external-dependencies
|
||||||
|1 io.ktor:ktor-io,io.ktor:ktor-io-$MASKED_TARGET_NAME[1.6.5] #0[1.6.5]
|
|1 io.ktor:ktor-io,io.ktor:ktor-io-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX[1.6.5] #0[1.6.5]
|
||||||
|${'\t'}/some/path/ktor-io.klib
|
|${'\t'}/some/path/ktor-io.klib
|
||||||
|${'\t'}/some/path/ktor-io-cinterop-bits.klib
|
|${'\t'}/some/path/ktor-io-cinterop-bits.klib
|
||||||
|${'\t'}/some/path/ktor-io-cinterop-sockets.klib
|
|${'\t'}/some/path/ktor-io-cinterop-sockets.klib
|
||||||
|2 org.jetbrains.kotlinx:atomicfu,org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME[0.16.3] #3[0.16.3] #1[0.16.3]
|
|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]
|
||||||
|${'\t'}/some/path/atomicfu.klib
|
|${'\t'}/some/path/atomicfu.klib
|
||||||
|${'\t'}/some/path/atomicfu-cinterop-interop.klib
|
|${'\t'}/some/path/atomicfu-cinterop-interop.klib
|
||||||
|3 org.jetbrains.kotlinx:kotlinx-coroutines-core,org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME[1.5.2-native-mt] #0[1.5.2-native-mt] #1[1.5.2-native-mt]
|
|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]
|
||||||
|${'\t'}/some/path/kotlinx-coroutines-core.klib
|
|${'\t'}/some/path/kotlinx-coroutines-core.klib
|
||||||
|
|
|
|
||||||
""".trimMargin(),
|
""".trimMargin(),
|
||||||
externalDependenciesText
|
externalDependenciesText
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buildProjectWithDependencies(
|
private fun buildProjectWithDependencies(
|
||||||
|
gradleVersion: GradleVersion,
|
||||||
vararg dependencies: String,
|
vararg dependencies: String,
|
||||||
externalDependenciesTextConsumer: (externalDependenciesText: String?) -> Unit
|
externalDependenciesTextConsumer: (externalDependenciesText: String?) -> Unit
|
||||||
) {
|
) {
|
||||||
with(transformNativeTestProjectWithPluginDsl("native-external-dependencies")) {
|
nativeProject("native-external-dependencies", gradleVersion) {
|
||||||
gradleBuildScript().appendText(
|
buildGradleKts.appendText(
|
||||||
"""
|
"""
|
||||||
|
|
|
|
||||||
|kotlin {
|
|kotlin {
|
||||||
@@ -98,27 +111,15 @@ class NativeExternalDependenciesIT : BaseGradleIT() {
|
|||||||
""".trimMargin()
|
""".trimMargin()
|
||||||
)
|
)
|
||||||
|
|
||||||
build(
|
build("buildExternalDependenciesFile") {
|
||||||
"buildExternalDependenciesFile"
|
|
||||||
) {
|
|
||||||
assertSuccessful()
|
|
||||||
assertTasksExecuted(":buildExternalDependenciesFile")
|
assertTasksExecuted(":buildExternalDependenciesFile")
|
||||||
val kotlinNativeTargetName = findKotlinNativeTargetName(output)
|
|
||||||
assertNotNull(kotlinNativeTargetName)
|
|
||||||
|
|
||||||
val externalDependenciesFile = findParameterInOutput("for_test_external_dependencies_file", output)?.let(::File)
|
val externalDependenciesFile = findParameterInOutput("for_test_external_dependencies_file", output)?.let(::File)
|
||||||
val externalDependenciesText = if (externalDependenciesFile?.exists() == true) {
|
val externalDependenciesText = if (externalDependenciesFile?.exists() == true) {
|
||||||
externalDependenciesFile.readText()
|
externalDependenciesFile.readText()
|
||||||
.lineSequence()
|
.lineSequence()
|
||||||
.map { line ->
|
.map { line ->
|
||||||
if (line.firstOrNull()?.isWhitespace() == true) {
|
if (line.firstOrNull()?.isWhitespace() == true) "\t/some/path/${File(line.trimStart()).name}" else line
|
||||||
// Transform artifact path.
|
|
||||||
val pureFileName = File(line.trimStart()).name
|
|
||||||
"\t/some/path/$pureFileName"
|
|
||||||
} else {
|
|
||||||
// Transform module name (mask target name).
|
|
||||||
line.replace(kotlinNativeTargetName, MASKED_TARGET_NAME)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.joinToString("\n")
|
.joinToString("\n")
|
||||||
} else null
|
} else null
|
||||||
@@ -128,19 +129,4 @@ class NativeExternalDependenciesIT : BaseGradleIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal companion object {
|
|
||||||
val MASKED_TARGET_NAME = "testTarget" + HostManager.host.architecture.name
|
|
||||||
|
|
||||||
fun hostIsMacArm64() = HostManager.host == KonanTarget.MACOS_ARM64
|
|
||||||
|
|
||||||
fun findParameterInOutput(name: String, output: String): String? =
|
|
||||||
output.lineSequence().mapNotNull { line ->
|
|
||||||
val (key, value) = line.split('=', limit = 2).takeIf { it.size == 2 } ?: return@mapNotNull null
|
|
||||||
if (key.endsWith(name)) value else null
|
|
||||||
}.firstOrNull()
|
|
||||||
|
|
||||||
fun findKotlinNativeTargetName(output: String): String? = findParameterInOutput("for_test_kotlin_native_target", output)
|
|
||||||
?.takeIf(String::isNotBlank)
|
|
||||||
?.lowercase(Locale.getDefault())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-30
@@ -7,9 +7,8 @@ package org.jetbrains.kotlin.gradle.native
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
import org.jetbrains.kotlin.gradle.BaseGradleIT
|
||||||
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
import org.jetbrains.kotlin.gradle.GradleVersionRequired
|
||||||
import org.jetbrains.kotlin.gradle.native.NativeExternalDependenciesIT.Companion.MASKED_TARGET_NAME
|
import org.jetbrains.kotlin.gradle.testbase.DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX
|
||||||
import org.jetbrains.kotlin.gradle.native.NativeExternalDependenciesIT.Companion.findKotlinNativeTargetName
|
import org.jetbrains.kotlin.gradle.testbase.findParameterInOutput
|
||||||
import org.jetbrains.kotlin.gradle.native.NativeExternalDependenciesIT.Companion.findParameterInOutput
|
|
||||||
import org.jetbrains.kotlin.konan.library.KONAN_PLATFORM_LIBS_NAME_PREFIX
|
import org.jetbrains.kotlin.konan.library.KONAN_PLATFORM_LIBS_NAME_PREFIX
|
||||||
import org.jetbrains.kotlin.konan.target.HostManager
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||||
@@ -49,18 +48,18 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
|||||||
|
|
|
|
||||||
|This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.
|
|This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.
|
||||||
|
|
|
|
||||||
|The list of libraries that depend on "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME)" and may lead to conflicts:
|
|The list of libraries that depend on "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX)" and may lead to conflicts:
|
||||||
|1. "io.ktor:ktor-client-core (io.ktor:ktor-client-core-$MASKED_TARGET_NAME): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.5.0-RC-native-mt" is used in the project)
|
|1. "io.ktor:ktor-client-core (io.ktor:ktor-client-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.0-RC-native-mt" is used in the project)
|
||||||
|2. "io.ktor:ktor-http (io.ktor:ktor-http-$MASKED_TARGET_NAME): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.5.0-RC-native-mt" is used in the project)
|
|2. "io.ktor:ktor-http (io.ktor:ktor-http-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.0-RC-native-mt" is used in the project)
|
||||||
|3. "io.ktor:ktor-http-cio (io.ktor:ktor-http-cio-$MASKED_TARGET_NAME): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.5.0-RC-native-mt" is used in the project)
|
|3. "io.ktor:ktor-http-cio (io.ktor:ktor-http-cio-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.0-RC-native-mt" is used in the project)
|
||||||
|4. "io.ktor:ktor-io (io.ktor:ktor-io-$MASKED_TARGET_NAME): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.5.0-RC-native-mt" is used in the project)
|
|4. "io.ktor:ktor-io (io.ktor:ktor-io-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.0-RC-native-mt" is used in the project)
|
||||||
|5. "io.ktor:ktor-utils (io.ktor:ktor-utils-$MASKED_TARGET_NAME): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.5.0-RC-native-mt" is used in the project)
|
|5. "io.ktor:ktor-utils (io.ktor:ktor-utils-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4" (was compiled against "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt" but "org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.0-RC-native-mt" is used in the project)
|
||||||
|
|
|
|
||||||
|Project dependencies:
|
|Project dependencies:
|
||||||
|+--- io.ktor:ktor-client-core (io.ktor:ktor-client-core-$MASKED_TARGET_NAME): 1.5.4
|
|+--- io.ktor:ktor-client-core (io.ktor:ktor-client-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4
|
||||||
|| +--- io.ktor:ktor-http (io.ktor:ktor-http-$MASKED_TARGET_NAME): 1.5.4
|
|| +--- io.ktor:ktor-http (io.ktor:ktor-http-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4
|
||||||
|| | +--- io.ktor:ktor-utils (io.ktor:ktor-utils-$MASKED_TARGET_NAME): 1.5.4
|
|| | +--- io.ktor:ktor-utils (io.ktor:ktor-utils-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4
|
||||||
|| | | +--- io.ktor:ktor-io (io.ktor:ktor-io-$MASKED_TARGET_NAME): 1.5.4
|
|| | | +--- io.ktor:ktor-io (io.ktor:ktor-io-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4
|
||||||
|| | | | +--- io.ktor:ktor-io-cinterop-bits: 1.5.4
|
|| | | | +--- io.ktor:ktor-io-cinterop-bits: 1.5.4
|
||||||
|| | | | | \--- stdlib: 1.4.32 -> $kotlinNativeCompilerVersion
|
|| | | | | \--- stdlib: 1.4.32 -> $kotlinNativeCompilerVersion
|
||||||
|| | | | +--- io.ktor:ktor-io-cinterop-sockets: 1.5.4
|
|| | | | +--- io.ktor:ktor-io-cinterop-sockets: 1.5.4
|
||||||
@@ -80,36 +79,36 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
|||||||
|| | | | | +--- stdlib: $kotlinNativeCompilerVersion
|
|| | | | | +--- stdlib: $kotlinNativeCompilerVersion
|
||||||
|| | | | | \--- org.jetbrains.kotlin.native.platform.posix: $kotlinNativeCompilerVersion (*)
|
|| | | | | \--- org.jetbrains.kotlin.native.platform.posix: $kotlinNativeCompilerVersion (*)
|
||||||
|| | | | +--- org.jetbrains.kotlin.native.platform.posix: 1.4.32 -> $kotlinNativeCompilerVersion (*)
|
|| | | | +--- org.jetbrains.kotlin.native.platform.posix: 1.4.32 -> $kotlinNativeCompilerVersion (*)
|
||||||
|| | | | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME): 0.15.1 -> 0.16.1
|
|| | | | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 0.15.1 -> 0.16.1
|
||||||
|| | | | | +--- stdlib: 1.5 -> $kotlinNativeCompilerVersion
|
|| | | | | +--- stdlib: 1.5 -> $kotlinNativeCompilerVersion
|
||||||
|| | | | | +--- org.jetbrains.kotlin.native.platform.posix: 1.5 -> $kotlinNativeCompilerVersion (*)
|
|| | | | | +--- org.jetbrains.kotlin.native.platform.posix: 1.5 -> $kotlinNativeCompilerVersion (*)
|
||||||
|| | | | | \--- org.jetbrains.kotlinx:atomicfu-cinterop-interop: 0.16.1
|
|| | | | | \--- org.jetbrains.kotlinx:atomicfu-cinterop-interop: 0.16.1
|
||||||
|| | | | | +--- stdlib: 1.5 -> $kotlinNativeCompilerVersion
|
|| | | | | +--- stdlib: 1.5 -> $kotlinNativeCompilerVersion
|
||||||
|| | | | | \--- org.jetbrains.kotlin.native.platform.posix: 1.5 -> $kotlinNativeCompilerVersion (*)
|
|| | | | | \--- org.jetbrains.kotlin.native.platform.posix: 1.5 -> $kotlinNativeCompilerVersion (*)
|
||||||
|| | | | +--- org.jetbrains.kotlinx:atomicfu-cinterop-interop: 0.16.1 (*)
|
|| | | | +--- org.jetbrains.kotlinx:atomicfu-cinterop-interop: 0.16.1 (*)
|
||||||
|| | | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt -> 1.5.0-RC-native-mt
|
|| | | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt -> 1.5.0-RC-native-mt
|
||||||
|| | | | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
|| | | | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
||||||
|| | | | +--- stdlib: 1.5 -> $kotlinNativeCompilerVersion
|
|| | | | +--- stdlib: 1.5 -> $kotlinNativeCompilerVersion
|
||||||
|| | | | +--- org.jetbrains.kotlin.native.platform.CoreFoundation: 1.5 -> $kotlinNativeCompilerVersion (*)
|
|| | | | +--- org.jetbrains.kotlin.native.platform.CoreFoundation: 1.5 -> $kotlinNativeCompilerVersion (*)
|
||||||
|| | | | +--- org.jetbrains.kotlin.native.platform.darwin: 1.5 -> $kotlinNativeCompilerVersion (*)
|
|| | | | +--- org.jetbrains.kotlin.native.platform.darwin: 1.5 -> $kotlinNativeCompilerVersion (*)
|
||||||
|| | | | +--- org.jetbrains.kotlin.native.platform.posix: 1.5 -> $kotlinNativeCompilerVersion (*)
|
|| | | | +--- org.jetbrains.kotlin.native.platform.posix: 1.5 -> $kotlinNativeCompilerVersion (*)
|
||||||
|| | | | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME): 0.16.1 (*)
|
|| | | | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 0.16.1 (*)
|
||||||
|| | | | \--- org.jetbrains.kotlinx:atomicfu-cinterop-interop: 0.16.1 (*)
|
|| | | | \--- org.jetbrains.kotlinx:atomicfu-cinterop-interop: 0.16.1 (*)
|
||||||
|| | | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME): 0.15.1 -> 0.16.1 (*)
|
|| | | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 0.15.1 -> 0.16.1 (*)
|
||||||
|| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
|| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
||||||
|| | | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
|| | | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
||||||
|| | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME): 0.15.1 -> 0.16.1 (*)
|
|| | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 0.15.1 -> 0.16.1 (*)
|
||||||
|| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
|| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
||||||
|| | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
|| | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
||||||
|| +--- io.ktor:ktor-http-cio (io.ktor:ktor-http-cio-$MASKED_TARGET_NAME): 1.5.4
|
|| +--- io.ktor:ktor-http-cio (io.ktor:ktor-http-cio-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4
|
||||||
|| | +--- io.ktor:ktor-http (io.ktor:ktor-http-$MASKED_TARGET_NAME): 1.5.4 (*)
|
|| | +--- io.ktor:ktor-http (io.ktor:ktor-http-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.4 (*)
|
||||||
|| | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME): 0.15.1 -> 0.16.1 (*)
|
|| | +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 0.15.1 -> 0.16.1 (*)
|
||||||
|| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
|| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
||||||
|| | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
|| | ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
||||||
|| +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$MASKED_TARGET_NAME): 0.15.1 -> 0.16.1 (*)
|
|| +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 0.15.1 -> 0.16.1 (*)
|
||||||
|| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
|| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)
|
||||||
|| ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
|| ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
||||||
|\--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$MASKED_TARGET_NAME): 1.5.0-RC-native-mt (*)
|
|\--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.5.0-RC-native-mt (*)
|
||||||
| ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
| ^^^ This module contains symbol kotlinx.coroutines/CancellationException|null[0] that is the cause of the conflict.
|
||||||
|
|
|
|
||||||
|(*) - dependencies omitted (listed previously)
|
|(*) - dependencies omitted (listed previously)
|
||||||
@@ -272,8 +271,6 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
|||||||
build("linkDebugExecutableNative") {
|
build("linkDebugExecutableNative") {
|
||||||
assertFailed()
|
assertFailed()
|
||||||
|
|
||||||
val kotlinNativeTargetName = findKotlinNativeTargetName(output)
|
|
||||||
assertNotNull(kotlinNativeTargetName)
|
|
||||||
|
|
||||||
val kotlinNativeCompilerVersion = findKotlinNativeCompilerVersion(output)
|
val kotlinNativeCompilerVersion = findKotlinNativeCompilerVersion(output)
|
||||||
assertNotNull(kotlinNativeCompilerVersion)
|
assertNotNull(kotlinNativeCompilerVersion)
|
||||||
@@ -281,7 +278,6 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|
|||||||
val errorMessage = ERROR_LINE_REGEX.findAll(getOutputForTask("linkDebugExecutableNative"))
|
val errorMessage = ERROR_LINE_REGEX.findAll(getOutputForTask("linkDebugExecutableNative"))
|
||||||
.map { matchResult -> matchResult.groupValues[1] }
|
.map { matchResult -> matchResult.groupValues[1] }
|
||||||
.filterNot { it.startsWith("w:") || it.startsWith("v:") || it.startsWith("i:") }
|
.filterNot { it.startsWith("w:") || it.startsWith("v:") || it.startsWith("i:") }
|
||||||
.map { line -> line.replace(kotlinNativeTargetName, MASKED_TARGET_NAME) }
|
|
||||||
.map { line ->
|
.map { line ->
|
||||||
line.replace(COMPRESSED_PLATFORM_LIBS_REGEX) { result ->
|
line.replace(COMPRESSED_PLATFORM_LIBS_REGEX) { result ->
|
||||||
val rangeWithPlatformLibrariesCount = result.groups[1]!!.range
|
val rangeWithPlatformLibrariesCount = result.groups[1]!!.range
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.gradle.testbase
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
|
import org.jetbrains.kotlin.konan.target.presetName
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
val DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX = HostManager.host.presetName.lowercase(Locale.getDefault())
|
||||||
+14
@@ -215,3 +215,17 @@ fun BuildResult.assertDeprecationWarningsArePresent(warningMode: WarningMode) {
|
|||||||
getWarningModeChangeAdvice(warningMode)
|
getWarningModeChangeAdvice(warningMode)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function searches for a given parameter in a multi-line output string and returns its value.
|
||||||
|
*
|
||||||
|
* The output string is assumed to be in the form of key-value pairs separated by an equal sign (‘=’) on each line.
|
||||||
|
*
|
||||||
|
* If the specified parameter name is found at the end of a key, the corresponding value is returned.
|
||||||
|
* If the parameter is not found, the function returns null.
|
||||||
|
*/
|
||||||
|
fun findParameterInOutput(name: String, output: String): String? =
|
||||||
|
output.lineSequence().mapNotNull { line ->
|
||||||
|
val (key, value) = line.split('=', limit = 2).takeIf { it.size == 2 } ?: return@mapNotNull null
|
||||||
|
if (key.endsWith(name)) value else null
|
||||||
|
}.firstOrNull()
|
||||||
+1
-2
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
id("org.jetbrains.kotlin.multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -24,7 +24,6 @@ val buildExternalDependenciesFile = tasks.register("buildExternalDependenciesFil
|
|||||||
.invoke(null, project)
|
.invoke(null, project)
|
||||||
?.toString().orEmpty()
|
?.toString().orEmpty()
|
||||||
|
|
||||||
println("for_test_kotlin_native_target=<SingleNativeTarget>")
|
|
||||||
println("for_test_external_dependencies_file=$externalDependenciesFile")
|
println("for_test_external_dependencies_file=$externalDependenciesFile")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -26,5 +26,4 @@ val konanHome: String? by ext.properties
|
|||||||
val kotlinNativeCompilerVersion = konanHome?.let { org.jetbrains.kotlin.konan.target.Distribution(it).compilerVersion }
|
val kotlinNativeCompilerVersion = konanHome?.let { org.jetbrains.kotlin.konan.target.Distribution(it).compilerVersion }
|
||||||
?: "<pluginMarkerVersion>"
|
?: "<pluginMarkerVersion>"
|
||||||
|
|
||||||
println("for_test_kotlin_native_target=<SingleNativeTarget>")
|
|
||||||
println("for_test_kotlin_native_compiler_version=$kotlinNativeCompilerVersion")
|
println("for_test_kotlin_native_compiler_version=$kotlinNativeCompilerVersion")
|
||||||
|
|||||||
-1
@@ -25,5 +25,4 @@ val konanHome: String? by ext.properties
|
|||||||
val kotlinNativeCompilerVersion = konanHome?.let { org.jetbrains.kotlin.konan.target.Distribution(it).compilerVersion }
|
val kotlinNativeCompilerVersion = konanHome?.let { org.jetbrains.kotlin.konan.target.Distribution(it).compilerVersion }
|
||||||
?: "<pluginMarkerVersion>"
|
?: "<pluginMarkerVersion>"
|
||||||
|
|
||||||
println("for_test_kotlin_native_target=<SingleNativeTarget>")
|
|
||||||
println("for_test_kotlin_native_compiler_version=$kotlinNativeCompilerVersion")
|
println("for_test_kotlin_native_compiler_version=$kotlinNativeCompilerVersion")
|
||||||
|
|||||||
-1
@@ -26,5 +26,4 @@ val konanHome: String? by ext.properties
|
|||||||
val kotlinNativeCompilerVersion = konanHome?.let { org.jetbrains.kotlin.konan.target.Distribution(it).compilerVersion }
|
val kotlinNativeCompilerVersion = konanHome?.let { org.jetbrains.kotlin.konan.target.Distribution(it).compilerVersion }
|
||||||
?: "<pluginMarkerVersion>"
|
?: "<pluginMarkerVersion>"
|
||||||
|
|
||||||
println("for_test_kotlin_native_target=<SingleNativeTarget>")
|
|
||||||
println("for_test_kotlin_native_compiler_version=$kotlinNativeCompilerVersion")
|
println("for_test_kotlin_native_compiler_version=$kotlinNativeCompilerVersion")
|
||||||
|
|||||||
Reference in New Issue
Block a user